diff --git a/.github/workflows/ci-conan.yml b/.github/workflows/ci-conan.yml index a3b869d0..a6d94ec7 100644 --- a/.github/workflows/ci-conan.yml +++ b/.github/workflows/ci-conan.yml @@ -56,7 +56,7 @@ jobs: - name: Install packages run: | sudo apt-get update - sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-util-dev libxcb-util0-dev + sudo apt-get install -y gcc g++ cmake wget git python3 python3-pip libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev libxcb-dri3-dev uuid-dev libxcb-util-dev libxcb-util0-dev libxcb-cursor-dev pip install ninja "conan>=1.51.0,<2.0.0" conan profile new --detect default conan profile update settings.compiler.libcxx=libstdc++11 default diff --git a/README.md b/README.md index 78c1c1a2..9f721855 100644 --- a/README.md +++ b/README.md @@ -38,9 +38,11 @@ One of the examples is an SVG Viewer. Cloned with history on May 6, 2019 (rev r132) from the official Sourceforge AGG project at https://svn.code.sf.net/p/agg/svn. +Updated with history on August 28, 2023 (rev r139) + ## License -AGG 2.6, along with the official Sourceforge AGG project, is based off of AGG 2.4, which +AGG 2.7, along with the official Sourceforge AGG project, is based off of AGG 2.4, which is dual licensed by either a Modified BSD License, or an Anti-Grain Geometry Public License. These licenses allow for free use in commercial software. diff --git a/agg-src/CMakeLists.txt b/agg-src/CMakeLists.txt index d941e9e9..22d22bb5 100644 --- a/agg-src/CMakeLists.txt +++ b/agg-src/CMakeLists.txt @@ -1,7 +1,7 @@ CMAKE_MINIMUM_REQUIRED( VERSION 3.13 ) PROJECT( agg - VERSION 2.6.1 + VERSION 2.7.1 LANGUAGES CXX) INCLUDE(GNUInstallDirs) diff --git a/agg-src/conanfile.py b/agg-src/conanfile.py index ca4d81f0..475be99b 100644 --- a/agg-src/conanfile.py +++ b/agg-src/conanfile.py @@ -1,51 +1,48 @@ -# pylint: disable=no-member +import os from conan import ConanFile +from conan.errors import ConanInvalidConfiguration from conan.tools.cmake import CMake, CMakeDeps, CMakeToolchain, cmake_layout -from conan.tools.microsoft import check_min_vs, msvc_runtime_flag, is_msvc, is_msvc_static_runtime -from conan.tools.files import copy, rmdir - -import os - -required_conan_version = '>=1.51.0, <2.0.0' # pylint: disable=invalid-name +from conan.tools.files import copy, get, rmdir +required_conan_version = ">=1.53.0" class AggConan(ConanFile): - name = 'agg' - version = '2.6.0' - description = 'AGG Anti-Grain Geometry Library' - topics = ('graphics') - url = 'https://github.com/aggeom/agg-2.6' - homepage = 'https://github.com/aggeom' - license = 'BSD-3-Clause' exports_sources = '*' - - settings = 'os', 'arch', 'compiler', 'build_type' + name = "aggeom-agg" + version = '2.7.1' + description = "AGG Anti-Grain Geometry Library" + license = "BSD-3-Clause" + url = "https://github.com/aggeom/agg-2.6" + homepage = "https://github.com/aggeom" + topics = ("graphics",) + + package_type = "library" + settings = "os", "arch", "compiler", "build_type" options = { - 'shared': [False], - 'fPIC': [True, False], - 'with_gpc': [True, False], - 'with_freetype': [True, False], - 'with_agg2d': [True, False], - 'with_agg2d_freetype': [True, False], - 'with_platform': [True, False], - 'with_controls': [True, False], + "shared": [True, False], + "fPIC": [True, False], + "with_gpc": [True, False], + "with_freetype": [True, False], + "with_agg2d": [True, False], + "with_agg2d_freetype": [True, False], + "with_platform": [True, False], + "with_controls": [True, False], } - default_options = { - 'shared': False, - 'fPIC': True, - 'with_gpc': True, - 'with_freetype': True, - 'with_agg2d': True, - 'with_agg2d_freetype': True, - 'with_platform': True, - 'with_controls': True, + "shared": False, + "fPIC": True, + "with_gpc": True, + "with_freetype": True, + "with_agg2d": True, + "with_agg2d_freetype": True, + "with_platform": True, + "with_controls": True, } - @property - def _build_subfolder(self): - return os.path.join(self.build_folder, 'agg') + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC def configure(self): if self.options.shared: @@ -56,23 +53,29 @@ def layout(self): def requirements(self): if self.options.with_freetype: - self.requires('freetype/2.13.0') + self.requires("freetype/2.13.0") if self.options.with_platform and self.settings.os in ["Linux"]: self.requires("xorg/system") + def validate(self): + if self.settings.os not in ("Windows", "Linux"): + raise ConanInvalidConfiguration("OS is not supported") + if self.options.shared: + raise ConanInvalidConfiguration("Invalid configuration") + def generate(self): tc = CMakeToolchain(self) - tc.variables['agg_USE_EXPAT'] = False - tc.variables['agg_USE_SDL_PLATFORM'] = False - tc.variables['agg_BUILD_DEMO'] = False - tc.variables['agg_BUILD_EXAMPLES'] = False - - tc.variables['agg_USE_GPC'] = self.options.with_gpc - tc.variables['agg_USE_FREETYPE'] = self.options.with_freetype - tc.variables['agg_USE_AGG2D'] = self.options.with_agg2d - tc.variables['agg_USE_AGG2D_FREETYPE'] = self.options.with_agg2d_freetype - tc.variables['agg_BUILD_PLATFORM'] = self.options.with_platform - tc.variables['agg_BUILD_CONTROLS'] = self.options.with_controls + tc.variables["agg_USE_EXPAT"] = False + tc.variables["agg_USE_SDL_PLATFORM"] = False + tc.variables["agg_BUILD_DEMO"] = False + tc.variables["agg_BUILD_EXAMPLES"] = False + + tc.variables["agg_USE_GPC"] = self.options.with_gpc + tc.variables["agg_USE_FREETYPE"] = self.options.with_freetype + tc.variables["agg_USE_AGG2D"] = self.options.with_agg2d + tc.variables["agg_USE_AGG2D_FREETYPE"] = self.options.with_agg2d_freetype + tc.variables["agg_BUILD_PLATFORM"] = self.options.with_platform + tc.variables["agg_BUILD_CONTROLS"] = self.options.with_controls tc.generate() @@ -92,45 +95,44 @@ def package(self): rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) def package_info(self): - self.cpp_info.set_property("cmake_file_name", "agg") - - lib_suffix = "d" if self.settings.build_type == "Debug" and self.options.debug_suffix else "" + self.cpp_info.filenames["cmake_find_package"] = "agg" + self.cpp_info.filenames["cmake_find_package_multi"] = "agg" + self.cpp_info.names["cmake_find_package"] = "agg" + self.cpp_info.names["cmake_find_package_multi"] = "agg" self.cpp_info.components["agg"].set_property("cmake_target_name", "agg::agg") - self.cpp_info.components["agg"].libs = ["agg" + lib_suffix] + self.cpp_info.components["agg"].libs = ["agg"] self.cpp_info.components["agg"].includedirs = [os.path.join("include", "agg")] if self.options.with_freetype: self.cpp_info.components["fontfreetype"].set_property("cmake_target_name", "agg::fontfreetype") - self.cpp_info.components["fontfreetype"].libs = ["aggfontfreetype" + lib_suffix] - self.cpp_info.components["fontfreetype"].includedirs = [os.path.join("include", "agg","fontfreetype")] - self.cpp_info.components["2d"].requires = ["agg"] - + self.cpp_info.components["fontfreetype"].libs = ["aggfontfreetype"] + self.cpp_info.components["fontfreetype"].includedirs = [os.path.join("include", "agg", "fontfreetype")] + self.cpp_info.components["fontfreetype"].requires = ["agg", "freetype::freetype"] + if self.options.with_gpc: self.cpp_info.components["gpc"].set_property("cmake_target_name", "agg::gpc") - self.cpp_info.components["gpc"].libs = [ "agggpc" + lib_suffix] - self.cpp_info.components["gpc"].includedirs = [os.path.join("include", "agg","gpc")] - + self.cpp_info.components["gpc"].libs = ["agggpc"] + self.cpp_info.components["gpc"].includedirs = [os.path.join("include", "agg", "gpc")] if self.options.with_agg2d: self.cpp_info.components["2d"].set_property("cmake_target_name", "agg::2d") - self.cpp_info.components["2d"].libs = ["agg2d" + lib_suffix] - self.cpp_info.components["2d"].includedirs = [os.path.join("include", "agg","2d")] + self.cpp_info.components["2d"].libs = ["agg2d"] + self.cpp_info.components["2d"].includedirs = [os.path.join("include", "agg", "2d")] self.cpp_info.components["2d"].requires = ["agg"] if self.options.with_agg2d_freetype: self.cpp_info.components["2d"].requires = ["agg", "fontfreetype"] if self.options.with_platform: - self.cpp_info.components["platform"].set_property("cmake_target_name", "agg::platform") - self.cpp_info.components["platform"].libs = ["aggplatform" + lib_suffix] - self.cpp_info.components["platform"].includedirs = [os.path.join("include", "agg","platform")] + self.cpp_info.components["platform"].libs = ["aggplatform"] + self.cpp_info.components["platform"].includedirs = [os.path.join("include", "agg", "platform")] if self.settings.os in ["Linux"]: self.cpp_info.components["platform"].requires = ["xorg::xorg", "agg"] if self.options.with_controls: self.cpp_info.components["controls"].set_property("cmake_target_name", "agg::controls") - self.cpp_info.components["controls"].libs = ["aggctrl" + lib_suffix] - self.cpp_info.components["controls"].includedirs = [os.path.join("include", "agg","ctrl")] + self.cpp_info.components["controls"].libs = ["aggctrl"] + self.cpp_info.components["controls"].includedirs = [os.path.join("include", "agg", "ctrl")] self.cpp_info.components["controls"].requires = ["agg"] \ No newline at end of file diff --git a/agg-src/configure.ac b/agg-src/configure.ac index 246e5b56..ba8867d3 100644 --- a/agg-src/configure.ac +++ b/agg-src/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(agg, 2.6.0) +AC_INIT(agg, 2.7.1) AC_CONFIG_SRCDIR(src/agg_arc.cpp) AC_CANONICAL_TARGET AC_CONFIG_HEADERS(include/config.h) @@ -127,7 +127,6 @@ AC_SUBST(x_libraries) dnl ############################################### dnl Settung up library version -AGG_LIB_VERSION="2:6:0" dnl current-´ / / dnl revision--´ / dnl age---´ diff --git a/agg-src/examples/BeOS/Makefile b/agg-src/examples/BeOS/Makefile index 7bf90c08..5a6de15d 100644 --- a/agg-src/examples/BeOS/Makefile +++ b/agg-src/examples/BeOS/Makefile @@ -338,48 +338,27 @@ clean: rm -rf gpc_test agg.ppm: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/agg.ppm to /examples/X11/" - @echo "Attempting to retrieve via wget: (will fail if wget is not installed)" - wget http://www.antigrain.com/agg.ppm + cp ../art/agg.ppm . compositing.ppm: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/compositing.ppm to /examples/X11/" - @echo "Attempting to retrieve via wget: (will fail if wget is not installed)" - wget http://www.antigrain.com/compositing.ppm + cp ../art/compositing.ppm . spheres.ppm: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/spheres.ppm to /examples/X11/" - @echo "Attempting to retrieve file: (will fail if wget is not installed)" - wget http://www.antigrain.com/spheres.ppm + cp ../art/spheres.ppm . shapes.txt: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/shapes.txt to /examples/X11/" - @echo "Attempting to retrieve file: (will fail if wget is not installed)" - wget http://www.antigrain.com/shapes.txt + cp ../art/shapes.txt . 1.sdf: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/1.sdf to /examples/macosx_carbon/" - @echo "Attempting to retrieve file: (will fail if wget is not installed)" - wget http://www.antigrain.com/1.sdf + cp ../art/1.sdf . 1.ppm: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/line_patterns.tar.gz to /examples/X11/ and decompress it" - @echo "Attempting to retrieve file: (will fail if wget is not installed)" - wget http://www.antigrain.com/line_patterns.tar.gz + cp ../art/line_patterns.tar.gz . gunzip line_patterns.tar.gz tar -xvf line_patterns.tar timesi.ttf: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/timesi.zip to /examples/X11/ and decompress it" - @echo "Attempting to retrieve file: (will fail if wget is not installed)" - wget http://www.antigrain.com/timesi.zip + cp ../art/timesi.zip . unzip -o timesi.zip ../freetype_test.o: ../freetype_test.cpp diff --git a/agg-src/examples/X11/Makefile b/agg-src/examples/X11/Makefile index f8af9846..f91213d6 100644 --- a/agg-src/examples/X11/Makefile +++ b/agg-src/examples/X11/Makefile @@ -12,6 +12,7 @@ CXXFREETYPEFLAGS= $(AGGCXXFLAGS) -Wall \ -I../../include \ -I../../font_freetype \ -I/usr/local/include/freetype2 \ +-I/usr/include/freetype2 \ -L../../src \ $(PIXFMT) @@ -277,6 +278,38 @@ gpc_test: ../gpc_test.o ../make_arrows.o ../make_gb_poly.o $(PLATFORMSOURCES) svg_test: ../svg_viewer/agg_svg_parser.o ../svg_viewer/agg_svg_path_renderer.o ../svg_viewer/agg_svg_path_tokenizer.o ../svg_viewer/svg_test.o $(PLATFORMSOURCES) tiger.svg $(CXX) $(CXXFLAGS) ../svg_viewer/agg_svg_parser.o ../svg_viewer/agg_svg_path_renderer.o ../svg_viewer/agg_svg_path_tokenizer.o ../svg_viewer/svg_test.o $(PLATFORMSOURCES) -o svg_test $(LIBS) -lfreetype -lexpat +clean: + rm -f ../*.o + rm -f ../svg_viewer/*.o + rm -f ../../src/platform/$(PLATFORM)/agg_platform_support.o + +agg.ppm: + cp ../art/agg.ppm . + +compositing.ppm: + cp ../art/compositing.ppm . + +spheres.ppm: + cp ../art/spheres.ppm . + +shapes.txt: + cp ../art/shapes.txt . + +1.sdf: + cp ../art/1.sdf . + +1.ppm: + cp ../art/line_patterns.tar.gz . + gunzip line_patterns.tar.gz + tar -xvf line_patterns.tar + +timesi.ttf: + cp ../art/timesi.zip . + unzip -o timesi.zip + +tiger.svg: + cp ../art/tiger.svg . + ../freetype_test.o: ../freetype_test.cpp @echo \< $*.cpp \> $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ diff --git a/agg-src/examples/X11/line_patterns.tar.gz b/agg-src/examples/X11/line_patterns.tar.gz new file mode 100644 index 00000000..a6a2c99a Binary files /dev/null and b/agg-src/examples/X11/line_patterns.tar.gz differ diff --git a/agg-src/examples/X11/tiger.svg b/agg-src/examples/X11/tiger.svg index 234c1673..5069db98 100644 --- a/agg-src/examples/X11/tiger.svg +++ b/agg-src/examples/X11/tiger.svg @@ -1,3 +1,4 @@ +<<<<<<< HEAD:examples/X11/tiger.svg @@ -726,3 +727,733 @@ +======= + + + +A less cute tiger + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>>>>>>> e230a4b (Remove dependence on antigrain.com for the examples):agg-2.4/examples/art/tiger.svg diff --git a/agg-src/examples/agg2d_demo.cpp b/agg-src/examples/agg2d_demo.cpp index 30c23f26..2e942698 100644 --- a/agg-src/examples/agg2d_demo.cpp +++ b/agg-src/examples/agg2d_demo.cpp @@ -394,7 +394,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/compositing.cpp b/agg-src/examples/compositing.cpp index 2d7a40a3..bf9b1cf3 100644 --- a/agg-src/examples/compositing.cpp +++ b/agg-src/examples/compositing.cpp @@ -352,7 +352,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "compositing") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/distortions.cpp b/agg-src/examples/distortions.cpp index 690cd29c..4c4f7a33 100644 --- a/agg-src/examples/distortions.cpp +++ b/agg-src/examples/distortions.cpp @@ -687,7 +687,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/flash_rasterizer.cpp b/agg-src/examples/flash_rasterizer.cpp index 900e4f83..4feef6a8 100644 --- a/agg-src/examples/flash_rasterizer.cpp +++ b/agg-src/examples/flash_rasterizer.cpp @@ -535,8 +535,8 @@ int agg_main(int argc, char* argv[]) char buf[256]; if(strcmp(fname, "shapes.txt") == 0) { - sprintf(buf, "File not found: %s. Download http://www.antigrain.com/%s\n" - "or copy it from another directory if available.", + sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" + "or copy it from the ../art directory.", fname, fname); } else diff --git a/agg-src/examples/flash_rasterizer2.cpp b/agg-src/examples/flash_rasterizer2.cpp index ea8aef93..ad734ffb 100644 --- a/agg-src/examples/flash_rasterizer2.cpp +++ b/agg-src/examples/flash_rasterizer2.cpp @@ -509,8 +509,8 @@ int agg_main(int argc, char* argv[]) char buf[256]; if(strcmp(fname, "shapes.txt") == 0) { - sprintf(buf, "File not found: %s. Download http://www.antigrain.com/%s\n" - "or copy it from another directory if available.", + sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" + "or copy it from the ../art directory.", fname, fname); } else diff --git a/agg-src/examples/freetype_test.cpp b/agg-src/examples/freetype_test.cpp index 65c5a743..ea67bed5 100644 --- a/agg-src/examples/freetype_test.cpp +++ b/agg-src/examples/freetype_test.cpp @@ -361,7 +361,7 @@ class the_application : public agg::platform_support else { message("Please copy file timesi.ttf to the current directory\n" - "or download it from http://www.antigrain.com/timesi.zip"); + "or unzip it from ../art/timesi.zip"); } return num_glyphs; diff --git a/agg-src/examples/image1.cpp b/agg-src/examples/image1.cpp index 680204cf..cb7c4b63 100644 --- a/agg-src/examples/image1.cpp +++ b/agg-src/examples/image1.cpp @@ -162,7 +162,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/image_alpha.cpp b/agg-src/examples/image_alpha.cpp index d5a2b245..523199c5 100644 --- a/agg-src/examples/image_alpha.cpp +++ b/agg-src/examples/image_alpha.cpp @@ -230,7 +230,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/image_filters.cpp b/agg-src/examples/image_filters.cpp index ea15b5ce..4c71ac1b 100644 --- a/agg-src/examples/image_filters.cpp +++ b/agg-src/examples/image_filters.cpp @@ -397,7 +397,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/image_perspective.cpp b/agg-src/examples/image_perspective.cpp index 905c59a3..26755eb6 100644 --- a/agg-src/examples/image_perspective.cpp +++ b/agg-src/examples/image_perspective.cpp @@ -281,7 +281,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/image_resample.cpp b/agg-src/examples/image_resample.cpp index d14bd80b..3ea96848 100644 --- a/agg-src/examples/image_resample.cpp +++ b/agg-src/examples/image_resample.cpp @@ -345,7 +345,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/image_transforms.cpp b/agg-src/examples/image_transforms.cpp index 14bc560c..98ce6fe5 100644 --- a/agg-src/examples/image_transforms.cpp +++ b/agg-src/examples/image_transforms.cpp @@ -431,7 +431,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "spheres") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/line_patterns.cpp b/agg-src/examples/line_patterns.cpp index d4ee39bd..03bd6a81 100644 --- a/agg-src/examples/line_patterns.cpp +++ b/agg-src/examples/line_patterns.cpp @@ -316,10 +316,10 @@ int agg_main(int argc, char* argv[]) { char buf[256]; sprintf(buf, "There must be files 1%s...9%s\n" - "Download and unzip:\n" - "http://www.antigrain.com/line_patterns.bmp.zip\n" + "Copy and unzip:\n" + "../art/line_patterns.bmp.zip\n" "or\n" - "http://www.antigrain.com/line_patterns.ppm.tar.gz\n", + "../art/line_patterns.ppm.tar.gz\n", app.img_ext(), app.img_ext()); app.message(buf); return 1; diff --git a/agg-src/examples/macosx_carbon/Makefile b/agg-src/examples/macosx_carbon/Makefile index e1fa5d2a..ebad632c 100644 --- a/agg-src/examples/macosx_carbon/Makefile +++ b/agg-src/examples/macosx_carbon/Makefile @@ -251,34 +251,19 @@ clean: rm -f ../../src/platform/$(PLATFORM)/agg_mac_pmap.o agg.bmp: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/agg.bmp to /examples/macosx_carbon/" - @echo "Attempting to retrieve via curl: (will fail if curl is not installed)" - curl -O http://www.antigrain.com/agg.bmp + cp ../art/agg.bmp . compositing.bmp: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/compositing.bmp to /examples/macosx_carbon/" - @echo "Attempting to retrieve via curl: (will fail if curl is not installed)" - curl -O http://www.antigrain.com/compositing.bmp + cp ../art/compositing.bmp . spheres.bmp: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/spheres.bmp to /examples/macosx_carbon/" - @echo "Attempting to retrieve file: (will fail if curl is not installed)" - curl -O http://www.antigrain.com/spheres.bmp + cp ../art/spheres.bmp . 1.sdf: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/1.sdf to /examples/macosx_carbon/" - @echo "Attempting to retrieve file: (will fail if curl is not installed)" - curl -O http://www.antigrain.com/1.sdf + cp ../art/1.sdf . 1.bmp: - @echo "Required file missing!!" - @echo "Please download http://www.antigrain.com/line_patterns.bmp.zip to /examples/macosx_carbon/ and decoompress it" - @echo "Attempting to retrieve file: (will fail if curl is not installed)" - curl -O http://www.antigrain.com/line_patterns.bmp.zip + cp ../art/line_patterns.bmp.zip . unzip -o line_patterns.bmp.zip %.app: diff --git a/agg-src/examples/macosx_sdl/Makefile b/agg-src/examples/macosx_sdl/Makefile index afba22a9..f22071b7 100644 --- a/agg-src/examples/macosx_sdl/Makefile +++ b/agg-src/examples/macosx_sdl/Makefile @@ -338,3 +338,51 @@ clean: rm -f trans_curve1_ft rm -f trans_curve2_ft rm -f gpc_test + +agg.bmp: + cp ../art/agg.bmp . + +compositing.bmp: + cp ../art/compositing.bmp . + +spheres.bmp: + cp ../art/spheres.bmp . + +1.sdf: + cp ../art/1.sdf . + +1.bmp: + cp ../art/line_patterns.bmp.zip . + unzip -o line_patterns.bmp.zip + +timesi.ttf: + cp ../art/timesi.zip . + unzip -o timesi.zip + +../freetype_test.o: ../freetype_test.cpp + @echo \< $*.cpp \> + $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ + +../trans_curve1_ft.o: ../trans_curve1_ft.cpp + @echo \< $*.cpp \> + $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ + +../trans_curve2_ft.o: ../trans_curve2_ft.cpp + @echo \< $*.cpp \> + $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ + +../../font_freetype/agg_font_freetype.o: ../../font_freetype/agg_font_freetype.cpp + @echo \< $*.cpp \> + $(CXX) -c $(CXXFREETYPEFLAGS) $*.cpp -o $@ + +../gpc_test.o: ../gpc_test.cpp + @echo \< $*.cpp \> + $(CXX) -c $(CXXFLAGS) -I../../gpc $*.cpp -o $@ + +%.o: %.cpp + @echo \< $*.cpp \> + $(CXX) -c $(CXXFLAGS) $*.cpp -o $@ + +.PHONY : clean + + diff --git a/agg-src/examples/mol_view.cpp b/agg-src/examples/mol_view.cpp index 7813dc33..dcc63f14 100644 --- a/agg-src/examples/mol_view.cpp +++ b/agg-src/examples/mol_view.cpp @@ -172,7 +172,8 @@ unsigned trim_cr_lf(char* buf) --len; ++pos; } - if(pos) strcpy(buf, buf + pos); + // Note that strcpy has undefined behavior if the strings overlap + if(pos) memmove(buf, buf + pos, len); // Trim "\n\r" at the end while(len && (buf[len-1] == '\n' || buf[len-1] == '\r')) --len; @@ -202,7 +203,7 @@ bool molecule::read(FILE* fd) unsigned len; if(!fgets(buf, 510, fd)) return false; len = trim_cr_lf(buf); - if(len > 128) len = 128; + if(len > 127) len = 127; if(len) memcpy(m_name, buf, len); m_name[len] = 0; @@ -800,7 +801,7 @@ class the_application : public agg::platform_support else { char buf[256]; - sprintf(buf, "File not found: '%s'. Download http://www.antigrain.com/%s\n", + sprintf(buf, "File not found: '%s'. Copy from ../art/%s\n", fname, fname); message(buf); } diff --git a/agg-src/examples/pattern_perspective.cpp b/agg-src/examples/pattern_perspective.cpp index 0e84cb30..ba677597 100644 --- a/agg-src/examples/pattern_perspective.cpp +++ b/agg-src/examples/pattern_perspective.cpp @@ -272,7 +272,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "agg") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/pattern_resample.cpp b/agg-src/examples/pattern_resample.cpp index 09f517d1..f2713675 100644 --- a/agg-src/examples/pattern_resample.cpp +++ b/agg-src/examples/pattern_resample.cpp @@ -373,7 +373,7 @@ int agg_main(int argc, char* argv[]) if(strcmp(img_name, "agg") == 0) { sprintf(buf, "File not found: %s%s. Download http://www.antigrain.com/%s%s\n" - "or copy it from another directory if available.", + "or copy it from the ../art directory.", img_name, app.img_ext(), img_name, app.img_ext()); } else diff --git a/agg-src/examples/svg_viewer/svg_test.cpp b/agg-src/examples/svg_viewer/svg_test.cpp index 170af41d..a70fe16a 100644 --- a/agg-src/examples/svg_viewer/svg_test.cpp +++ b/agg-src/examples/svg_viewer/svg_test.cpp @@ -230,7 +230,7 @@ int agg_main(int argc, char* argv[]) if(fd == 0) { app.message("Usage: svg_test \n" - "Download http://antigrain.com/svg/tiger.svg"); + "Copy ../art/tiger.svg"); return 1; } fclose(fd); diff --git a/agg-src/examples/trans_curve1_ft.cpp b/agg-src/examples/trans_curve1_ft.cpp index c59bee84..490f2d90 100644 --- a/agg-src/examples/trans_curve1_ft.cpp +++ b/agg-src/examples/trans_curve1_ft.cpp @@ -177,7 +177,7 @@ class the_application : public agg::platform_support else { message("Please copy file timesi.ttf to the current directory\n" - "or download it from http://www.antigrain.com/timesi.zip"); + "or unzip it from ../art/timesi.zip"); } diff --git a/agg-src/examples/trans_curve2_ft.cpp b/agg-src/examples/trans_curve2_ft.cpp index 3374e611..1e207cdf 100644 --- a/agg-src/examples/trans_curve2_ft.cpp +++ b/agg-src/examples/trans_curve2_ft.cpp @@ -204,7 +204,7 @@ class the_application : public agg::platform_support else { message("Please copy file timesi.ttf to the current directory\n" - "or download it from http://www.antigrain.com/timesi.zip"); + "or unzip it from ../art/timesi.zip"); } diff --git a/agg-src/examples/win32_api/compositing/readme b/agg-src/examples/win32_api/compositing/readme index 6c39253b..226ae605 100644 --- a/agg-src/examples/win32_api/compositing/readme +++ b/agg-src/examples/win32_api/compositing/readme @@ -1 +1 @@ -Download http://www.antigrain.com/compositing.bmp before running this example. +Copy compositing.bmp from ..\..\art before running this example. diff --git a/agg-src/examples/win32_api/distortions/readme b/agg-src/examples/win32_api/distortions/readme index f6e9dcd0..07d1c1c8 100644 --- a/agg-src/examples/win32_api/distortions/readme +++ b/agg-src/examples/win32_api/distortions/readme @@ -1,4 +1,4 @@ -Download http://www.antigrain.com/spheres.bmp before running this example +Copy spheres.bmp from ..\..\art before running this example Use the sliders and the radio-buttons to change the parameters of the distortions. Drag the center of the distortions. Don't try to understand the shamanic manipulations with affine matrices diff --git a/agg-src/examples/win32_api/freetype_test/readme b/agg-src/examples/win32_api/freetype_test/readme index 1b231298..4dd950b0 100644 --- a/agg-src/examples/win32_api/freetype_test/readme +++ b/agg-src/examples/win32_api/freetype_test/readme @@ -1,7 +1,6 @@ This example demonstrates the use of the FreeType font rendering engine (http://freetype.org). Please get file "timesi.ttf" before -running this example. You can download it from: -http://www.antigrain.com/timesi.zip +running this example. You can copy timesi.zip from ..\..\art Note that the building environment expects FreeType installed into the root directory, that is, "\freetype2". diff --git a/agg-src/examples/win32_api/image1/readme b/agg-src/examples/win32_api/image1/readme index d823d3da..ec931235 100644 --- a/agg-src/examples/win32_api/image1/readme +++ b/agg-src/examples/win32_api/image1/readme @@ -1 +1 @@ -Download http://www.antigrain.com/spheres.bmp before running this example \ No newline at end of file +Copy spheres.bmp from ..\..\art before running this example \ No newline at end of file diff --git a/agg-src/examples/win32_api/image_alpha/readme b/agg-src/examples/win32_api/image_alpha/readme index 8aa31ddc..8aa5db7e 100644 --- a/agg-src/examples/win32_api/image_alpha/readme +++ b/agg-src/examples/win32_api/image_alpha/readme @@ -1 +1 @@ -Download http://www.antigrain.com/spheres.bmp before running this example. +Copy spheres.bmp from ..\..\art before running this example. diff --git a/agg-src/examples/win32_api/image_filters/readme b/agg-src/examples/win32_api/image_filters/readme index 8aa31ddc..8aa5db7e 100644 --- a/agg-src/examples/win32_api/image_filters/readme +++ b/agg-src/examples/win32_api/image_filters/readme @@ -1 +1 @@ -Download http://www.antigrain.com/spheres.bmp before running this example. +Copy spheres.bmp from ..\..\art before running this example. diff --git a/agg-src/examples/win32_api/image_filters2/readme b/agg-src/examples/win32_api/image_filters2/readme index 8aa31ddc..8aa5db7e 100644 --- a/agg-src/examples/win32_api/image_filters2/readme +++ b/agg-src/examples/win32_api/image_filters2/readme @@ -1 +1 @@ -Download http://www.antigrain.com/spheres.bmp before running this example. +Copy spheres.bmp from ..\..\art before running this example. diff --git a/agg-src/examples/win32_api/image_perspective/readme b/agg-src/examples/win32_api/image_perspective/readme index 8aa31ddc..8aa5db7e 100644 --- a/agg-src/examples/win32_api/image_perspective/readme +++ b/agg-src/examples/win32_api/image_perspective/readme @@ -1 +1 @@ -Download http://www.antigrain.com/spheres.bmp before running this example. +Copy spheres.bmp from ..\..\art before running this example. diff --git a/agg-src/examples/win32_api/image_resample/readme b/agg-src/examples/win32_api/image_resample/readme index 8aa31ddc..8aa5db7e 100644 --- a/agg-src/examples/win32_api/image_resample/readme +++ b/agg-src/examples/win32_api/image_resample/readme @@ -1 +1 @@ -Download http://www.antigrain.com/spheres.bmp before running this example. +Copy spheres.bmp from ..\..\art before running this example. diff --git a/agg-src/examples/win32_api/image_transforms/readme! b/agg-src/examples/win32_api/image_transforms/readme! index cc065617..f7241bb4 100644 --- a/agg-src/examples/win32_api/image_transforms/readme! +++ b/agg-src/examples/win32_api/image_transforms/readme! @@ -14,7 +14,7 @@ //---------------------------------------------------------------------------- IMPORTANT! -Download http://www.antigrain.com/spheres.bmp before running this example. +Copy spheres.bmp from ..\..\art before running this example. Using affine transformations for images looks tricky, but it's not, especially diff --git a/agg-src/examples/win32_api/mol_view/readme b/agg-src/examples/win32_api/mol_view/readme index 0155691f..0c52e2af 100644 --- a/agg-src/examples/win32_api/mol_view/readme +++ b/agg-src/examples/win32_api/mol_view/readme @@ -1,2 +1,2 @@ -Download http://www.antigrain.com/1.sdf before running this example. +Copy 1.sdf from ..\..\art before running this example. Press PageUp/PgDown to switch between different molecules. diff --git a/agg-src/include/agg_curves.h b/agg-src/include/agg_curves.h index 1ef02e87..63a48133 100644 --- a/agg-src/include/agg_curves.h +++ b/agg-src/include/agg_curves.h @@ -96,6 +96,7 @@ namespace agg public: curve3_div() : m_approximation_scale(1.0), + m_distance_tolerance_square(0.0), m_angle_tolerance(0.0), m_count(0) {} @@ -376,6 +377,7 @@ namespace agg public: curve4_div() : m_approximation_scale(1.0), + m_distance_tolerance_square(0.0), m_angle_tolerance(0.0), m_cusp_limit(0.0), m_count(0) diff --git a/agg-src/include/agg_math_stroke.h b/agg-src/include/agg_math_stroke.h index 6a9d6047..b1397113 100644 --- a/agg-src/include/agg_math_stroke.h +++ b/agg-src/include/agg_math_stroke.h @@ -172,11 +172,9 @@ namespace agg { double a1 = std::atan2(dy1 * m_width_sign, dx1 * m_width_sign); double a2 = std::atan2(dy2 * m_width_sign, dx2 * m_width_sign); - double da = a1 - a2; + double da = std::acos(m_width_abs / (m_width_abs + 0.125 / m_approx_scale)) * 2; int i, n; - da = std::acos(m_width_abs / (m_width_abs + 0.125 / m_approx_scale)) * 2; - add_vertex(vc, x + dx1, y + dy1); if(m_width_sign > 0) { diff --git a/agg-src/include/agg_pixfmt_rgba.h b/agg-src/include/agg_pixfmt_rgba.h index c9172f62..2c7223c3 100644 --- a/agg-src/include/agg_pixfmt_rgba.h +++ b/agg-src/include/agg_pixfmt_rgba.h @@ -2371,7 +2371,7 @@ namespace agg //-------------------------------------------------------------------- AGG_INLINE void copy_pixel(int x, int y, const color_type& c) { - make_pix(pix_value_ptr(x, y, 1), c); + pix_value_ptr(x, y, 1)->set(c); } //-------------------------------------------------------------------- diff --git a/agg-src/include/agg_trans_affine.h b/agg-src/include/agg_trans_affine.h index cb28421e..0e188c9d 100644 --- a/agg-src/include/agg_trans_affine.h +++ b/agg-src/include/agg_trans_affine.h @@ -317,8 +317,8 @@ namespace agg //------------------------------------------------------------------------ inline double trans_affine::scale() const { - double x = 0.707106781 * sx + 0.707106781 * shx; - double y = 0.707106781 * shy + 0.707106781 * sy; + double x = 0.70710678118654752440 * sx + 0.70710678118654752440 * shx; + double y = 0.70710678118654752440 * shy + 0.70710678118654752440 * sy; return std::sqrt(x*x + y*y); } diff --git a/agg-src/test_package/CMakeLists.txt b/agg-src/test_package/CMakeLists.txt index 31b14486..5c9ab68d 100644 --- a/agg-src/test_package/CMakeLists.txt +++ b/agg-src/test_package/CMakeLists.txt @@ -4,7 +4,7 @@ project(test_package LANGUAGES CXX) find_package(agg REQUIRED CONFIG) add_executable(${PROJECT_NAME} test_package.cpp) -target_link_libraries(${PROJECT_NAME} PRIVATE agg::agg ) +target_link_libraries(${PROJECT_NAME} PRIVATE agg::agg agg::platform ) set_target_properties(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)