diff --git a/AUTHORS b/AUTHORS index d170cb3..06f222b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,3 +1,3 @@ -Picasso - Version 2.5 +Picasso - Version 2.8 A high quality vector graphic rendering library -Copyright (C) 2008 ~ 2023 Zhang Ji Peng (onecoolx@gmail.com) +Copyright (C) 2008 ~ 2024 Zhang Ji Peng (onecoolx@gmail.com) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d27c11..2771cb3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,8 @@ set(BUILD_SHARED_LIBS ON) # build shared library, OFF for static set(PROJECT_ROOT ${CMAKE_CURRENT_LIST_DIR}) +set(VERSION_INFO 2.8.0) + if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build Type" FORCE) endif() @@ -15,6 +17,7 @@ include (${CMAKE_CURRENT_LIST_DIR}/build/defines.cmake) include (${CMAKE_CURRENT_LIST_DIR}/third_party/third_party.cmake) include (${CMAKE_CURRENT_LIST_DIR}/src/src.cmake) include (${CMAKE_CURRENT_LIST_DIR}/ext/ext.cmake) +include (${CMAKE_CURRENT_LIST_DIR}/include/include.cmake) include (${CMAKE_CURRENT_LIST_DIR}/test/test.cmake) include (${CMAKE_CURRENT_LIST_DIR}/demos/demos.cmake) diff --git a/ChangeLog b/ChangeLog index 7b1eb01..3f565ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ 2013-02-12: Version 2.0.0 Update code version 2.0.0 alpha. + Change to BSD license. 2014-07-16: Version 2.0.1 Fix font glyph advance_x bug. diff --git a/COPYING b/LICENSE similarity index 96% rename from COPYING rename to LICENSE index d216af5..5298353 100644 --- a/COPYING +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2014, Zhang Ji Peng +Copyright (c) 2024, Zhang Ji Peng All rights reserved. Redistribution and use in source and binary forms, with or without modification, diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 93fce5a..0000000 --- a/Makefile.am +++ /dev/null @@ -1,9 +0,0 @@ -ACLOCAL_AMFLAGS = -I m4 -SUBDIRS = include src test demos - -if PSX_IMAGE_SUPPORT -SUBDIRS += ext -endif - -include_HEADERS = pconfig.h - diff --git a/NEWS b/NEWS deleted file mode 100644 index e69de29..0000000 diff --git a/README b/README index 6bd77b6..7152e09 100644 --- a/README +++ b/README @@ -1,36 +1,24 @@ HOW TO BUILD: ------------------------------------ linux: - -1. automake & autoconf -./autogen.sh -./configure -make -sudo make install; - - -2. gyp build +1. Install cmake above v3.16 on your system +2. Build project ./build_linux.sh cd proj make - ------------------------------------ windows: - -1. Install Active Python 2.7 on your windows system and register path environment variables. - +1. Install cmake above v3.16 on your windows system and register path environment variables. 2. Build project ./build_windows.bat -cd vcproj +cd proj ------------------------------------- macosx: - 1. Install python 2.7 on your shell environment. - 2. Build project ./build_macosx.sh cd proj diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 118f10a..0000000 --- a/autogen.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh - -touch ./INSTALL - -echo n | libtoolize --copy --force -aclocal -autoconf -autoheader -automake --add-missing - diff --git a/clean_code.sh b/clean_code.sh deleted file mode 100755 index 6f5510e..0000000 --- a/clean_code.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -make clean -make distclean - -rm -rf INSTALL -rm -rf Makefile.in -rm -rf aclocal.m4 -rm -rf autom4te.cache/ -rm -rf config.guess -rm -rf config.sub -rm -rf configure -rm -rf demos/Makefile.in -rm -rf depcomp -rm -rf compile -rm -rf ext/Makefile.in -rm -rf ext/image_loader/Makefile.in -rm -rf ext/image_loader/gif/Makefile.in -rm -rf ext/image_loader/jpeg/Makefile.in -rm -rf ext/image_loader/png/Makefile.in -rm -rf ext/image_loader/webp/Makefile.in -rm -rf include/Makefile.in -rm -rf install-sh -rm -rf ltmain.sh -rm -rf m4/ -rm -rf missing -rm -rf pconfig.h.in -rm -rf src/Makefile.in -rm -rf test/Makefile.in -find . -name "*.gcno"|xargs rm -rf diff --git a/configure.in b/configure.in deleted file mode 100644 index d04ec2e..0000000 --- a/configure.in +++ /dev/null @@ -1,313 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_PREREQ(2.59) -AC_INIT(picasso, 2.5, onecoolx@gmail.com) - -VERSION_MAJOR=2 -VERSION_MINOR=5 -VERSION_MICRO=0 -VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_MICRO -AC_SUBST(VERSION_MAJOR) -AC_SUBST(VERSION_MINOR) -AC_SUBST(VERSION_MICRO) -AC_SUBST(VERSION) - -AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, $VERSION) -AC_CONFIG_MACRO_DIR(m4) -AC_CONFIG_HEADER(pconfig.h) - -# Checks for programs. -AC_PROG_CXX -AC_PROG_CC -AC_PROG_INSTALL -AC_PROG_MAKE_SET -AC_PROG_LIBTOOL - -AC_PREFIX_DEFAULT(/usr/local) - -# User define macro. -build_freetype2="yes" -build_fontconfig="yes" -build_fastcopy="yes" -build_sysmalloc="no" -build_lowmem="no" -build_coverage="no" - -format_rgba="yes" -format_argb="yes" -format_abgr="yes" -format_bgra="yes" -format_rgb="yes" -format_bgr="yes" -format_rgb565="yes" -format_rgb555="yes" - -build_image="yes" -build_gif_support="yes" -build_jpg_support="yes" -build_png_support="yes" -build_webp_support="yes" - -build_gles2_backend="yes" - -# Check user define macro. -AC_ARG_ENABLE(freetype2, -[ --enable-freetype2 Build FreeType2 support ], -build_freetype2=$enableval) - -AC_ARG_ENABLE(fontconfig, -[ --enable-fontconfig Build FontConfig support ], -build_fontconfig=$enableval) - -AC_ARG_ENABLE(lowmem, -[ --enable-lowmem Build Low Memory used support ], -build_lowmem=$enableval) - -AC_ARG_ENABLE(fastcopy, -[ --enable-fastcopy Build Fast Memory Copy used support ], -build_fastcopy=$enableval) - -AC_ARG_ENABLE(coverage, -[ --enable-coverage Build Code coverage test ], -build_coverage=$enableval) - -AC_ARG_ENABLE(sysmalloc, -[ --enable-sysmalloc Build System Memory Allocator - (new/delete/malloc/free/realloc/calloc) used support ], -build_sysmalloc=$enableval) - -AC_ARG_ENABLE(rgba, -[ --enable-rgba Pixel format RGBA support ], -format_rgba=$enableval) - -AC_ARG_ENABLE(argb, -[ --enable-argb Pixel format ARGB support ], -format_argb=$enableval) - -AC_ARG_ENABLE(abgr, -[ --enable-abgr Pixel format ABGR support ], -format_abgr=$enableval) - -AC_ARG_ENABLE(bgra, -[ --enable-bgra Pixel format BGRA support ], -format_bgra=$enableval) - -AC_ARG_ENABLE(rgb, -[ --enable-rgb Pixel format RGB support ], -format_rgb=$enableval) - -AC_ARG_ENABLE(bgr, -[ --enable-bgr Pixel format BGR support ], -format_bgr=$enableval) - -AC_ARG_ENABLE(rgb565, -[ --enable-rgb565 Pixel format RGB565 support ], -format_rgb565=$enableval) - -AC_ARG_ENABLE(rgb555, -[ --enable-rgb555 Pixel format RGB555 support ], -format_rgb555=$enableval) - -AC_ARG_ENABLE(image, -[ --enable-image Image encoder and decoder support ], -build_image=$enableval) - -AC_ARG_ENABLE(gif, -[ --enable-gif Gif Image support ], -build_gif_support=$enableval) - -AC_ARG_ENABLE(png, -[ --enable-png Png Image support ], -build_png_support=$enableval) - -AC_ARG_ENABLE(jpg, -[ --enable-jpg Jpeg Image support ], -build_jpg_support=$enableval) - -AC_ARG_ENABLE(webp, -[ --enable-webp WebP Image support ], -build_webp_support=$enableval) - -AC_ARG_ENABLE(gles2, -[ --enable-gles2 OpenGL ES 2.0 Backend support ], -build_gles2_backend=$enableval) - -# Checks for libraries. - -# Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(memory.h stddef.h stdlib.h string.h) - -# Checks for typedefs, structures, and compiler characteristics. -AC_HEADER_STDBOOL -AC_C_CONST -AC_C_INLINE -AC_TYPE_SIZE_T - -# Checks for library functions. -AC_FUNC_MALLOC -AC_CHECK_FUNCS(floor memmove memset pow sqrt strncpy strncasecmp) - -# Checks for User define macro. -have_freetype2="no" -if test "x$build_freetype2" = "xyes"; then - AC_CHECK_LIB(freetype, FT_New_Face, [ - CFLAGS="$CFLAGS `pkg-config freetype2 --cflags`" - CPPFLAGS="$CPPFLAGS `pkg-config freetype2 --cflags`" - CXXFLAGS="$CXXFLAGS `pkg-config freetype2 --cflags`" - LIBS="$LIBS `pkg-config freetype2 --libs`" - AC_CHECK_HEADERS(ft2build.h, [ - have_freetype2="yes" - AC_DEFINE(ENABLE_FREE_TYPE2, 1, [Define if FreeType2 is supported.]) - ]) - ]) - if test "x$have_freetype2" = "xno"; then - AC_MSG_ERROR([freetype2 headers and/or libs where not found, install them or build with --disable-freetype2 on Windows]) - fi -else - LIBS="$LIBS -lgdi32" -fi - -if test "x$build_fontconfig" = "xyes"; then - AC_CHECK_LIB(fontconfig, FcInit, [ - CFLAGS="$CFLAGS `pkg-config fontconfig --cflags`" - CPPFLAGS="$CPPFLAGS `pkg-config fontconfig --cflags`" - CXXFLAGS="$CXXFLAGS `pkg-config fontconfig --cflags`" - LIBS="$LIBS `pkg-config fontconfig --libs`" - AC_CHECK_HEADERS(fontconfig/fontconfig.h, [ - AC_DEFINE(ENABLE_FONT_CONFIG, 1, [Define if FontConfig is supported.]) - ]) - ]) -fi - -if test "x$build_gles2_backend" = "xyes"; then - AC_CHECK_LIB(GLESv2, glGetString, [ - LIBS="$LIBS -lGLESv2" - AC_CHECK_HEADERS(GLES2/gl2.h, [ - AC_DEFINE(ENABLE_GLES2_SUPPORT, 1, [Define if gles 2.0 backend is supported.]) - ]) - ]) -fi - -if test "x$build_lowmem" = "xyes"; then - AC_DEFINE(ENABLE_LOW_MEMORY, 1, [Define if Low memory is supported.]) -fi - -if test "x$build_fastcopy" = "xyes"; then - AC_DEFINE(ENABLE_FAST_COPY, 1, [Define if Fast memory copy is supported.]) -fi - -if test "x$build_sysmalloc" = "xyes"; then - AC_DEFINE(ENABLE_SYSTEM_MALLOC, 1, [Define if System memory allocator is supported.]) -fi - -if test "x$format_rgba" = "xyes"; then - AC_DEFINE(ENABLE_FORMAT_RGBA, 1, [Define if RGBA color format is supported.]) -fi - -if test "x$format_argb" = "xyes"; then - AC_DEFINE(ENABLE_FORMAT_ARGB, 1, [Define if ARGB color format is supported.]) -fi - -if test "x$format_abgr" = "xyes"; then - AC_DEFINE(ENABLE_FORMAT_ABGR, 1, [Define if ABGR color format is supported.]) -fi - -if test "x$format_bgra" = "xyes"; then - AC_DEFINE(ENABLE_FORMAT_BGRA, 1, [Define if BGRA color format is supported.]) -fi - -if test "x$format_rgb" = "xyes"; then - AC_DEFINE(ENABLE_FORMAT_RGB, 1, [Define if RGB color format is supported.]) -fi - -if test "x$format_bgr" = "xyes"; then - AC_DEFINE(ENABLE_FORMAT_BGR, 1, [Define if BGR color format is supported.]) -fi - -if test "x$format_rgb565" = "xyes"; then - AC_DEFINE(ENABLE_FORMAT_RGB565, 1, [Define if RGB565 color format is supported.]) -fi - -if test "x$format_rgb555" = "xyes"; then - AC_DEFINE(ENABLE_FORMAT_RGB555, 1, [Define if RGB555 color format is supported.]) -fi - -if test "x$build_image" = "xyes"; then - if test "x$build_gif_support" = "xyes"; then - build_gif_support="no" - AC_CHECK_LIB(gif, DGifOpenFileName, [ - AC_CHECK_HEADERS(gif_lib.h, [ - build_gif_support="yes" - ]) - ]) - if test "x$build_gif_support" = "xno"; then - AC_MSG_WARN([giflib headers and/or libs where not found, gif support disabled!]) - fi - fi - - if test "x$build_png_support" = "xyes"; then - build_png_support="no" - AC_CHECK_LIB(png, png_get_copyright, [ - AC_CHECK_HEADERS(png.h, [ - build_png_support="yes" - ]) - ]) - if test "x$build_png_support" = "xno"; then - AC_MSG_WARN([libpng headers and/or libs where not found, png support disabled!]) - fi - fi - - if test "x$build_jpg_support" = "xyes"; then - build_jpg_support="no" - AC_CHECK_LIB(jpeg, jpeg_read_header, [ - AC_CHECK_HEADERS(jpeglib.h, [ - build_jpg_support="yes" - ]) - ]) - if test "x$build_jpg_support" = "xno"; then - AC_MSG_WARN([libjpeg headers and/or libs where not found, jpg support disabled!]) - fi - fi - - if test "x$build_webp_support" = "xyes"; then - build_webp_support="no" - AC_CHECK_LIB(webp, WebPGetDecoderVersion, [ - AC_CHECK_HEADERS(webp/decode.h, [ - build_webp_support="yes" - ]) - ]) - if test "x$build_webp_support" = "xno"; then - AC_MSG_WARN([libwebp headers and/or libs where not found, webp support disabled!]) - fi - fi -fi - -if test "x$build_coverage" = "xyes"; then - CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" - CXXFLAGS="$CXXFLAGS -fprofile-arcs -ftest-coverage" -fi - -AM_CONDITIONAL(PSX_IMAGE_SUPPORT, test "x$build_image" = "xyes") -AM_CONDITIONAL(PSX_IMAGE_GIF_SUPPORT, test "x$build_gif_support" = "xyes") -AM_CONDITIONAL(PSX_IMAGE_PNG_SUPPORT, test "x$build_png_support" = "xyes") -AM_CONDITIONAL(PSX_IMAGE_JPG_SUPPORT, test "x$build_jpg_support" = "xyes") -AM_CONDITIONAL(PSX_IMAGE_WEBP_SUPPORT, test "x$build_webp_support" = "xyes") - -CFLAGS="$CFLAGS -Wall -DDLL_EXPORT=1 -DEXPORT=1 -fvisibility=hidden" -CXXFLAGS="$CXXFLAGS -Wall -fno-rtti -fno-exceptions -DDLL_EXPORT=1 -DEXPORT=1 -fvisibility=hidden -fvisibility-inlines-hidden" - -AC_OUTPUT( -Makefile -include/Makefile -src/Makefile -ext/Makefile -ext/image_loader/Makefile -ext/image_loader/png/Makefile -ext/image_loader/jpeg/Makefile -ext/image_loader/gif/Makefile -ext/image_loader/webp/Makefile -test/Makefile -demos/Makefile -) diff --git a/demos/Makefile.am b/demos/Makefile.am deleted file mode 100644 index 02634da..0000000 --- a/demos/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -TOP_DIR=.. - -EXTRA_DIST = \ - interface.h \ - timeuse.h \ - clock.c \ - flowers.c \ - lake.c \ - platform_gix.c \ - platform_gtk2.c \ - platform_minigui.c \ - platform_win32.c \ - subwaymap.c \ - tiger.c \ - platform_qt4.cpp \ - GNUmakefile.gix \ - GNUmakefile.gtk2 \ - GNUmakefile.minigui \ - GNUmakefile.qt4 \ - lake.bmp diff --git a/ext/Makefile.am b/ext/Makefile.am deleted file mode 100644 index 3688e44..0000000 --- a/ext/Makefile.am +++ /dev/null @@ -1,2 +0,0 @@ -SUBDIRS = image_loader - diff --git a/ext/image_loader/Makefile.am b/ext/image_loader/Makefile.am deleted file mode 100644 index a5cc4d7..0000000 --- a/ext/image_loader/Makefile.am +++ /dev/null @@ -1,39 +0,0 @@ -SUBDIRS = - -if PSX_IMAGE_GIF_SUPPORT -SUBDIRS += gif -endif - -if PSX_IMAGE_PNG_SUPPORT -SUBDIRS += png -endif - -if PSX_IMAGE_JPG_SUPPORT -SUBDIRS += jpeg -endif - -if PSX_IMAGE_WEBP_SUPPORT -SUBDIRS += webp -endif - -INCLUDES = -I./ \ - -I../../ \ - -I../../build \ - -I../../include - -lib_LTLIBRARIES = libpsx_image.la - -libpsx_image_la_SOURCES = \ - psx_color_convert.h \ - psx_list.h \ - psx_image_io.h \ - psx_image_io.c \ - psx_image_loader.h \ - psx_image_loader.c \ - psx_image_modules.h \ - psx_image_modules.c - -libpsx_image_la_LDFLAGS = -no-undefined -release $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO) - -libpsx_image_la_LIBADD = ../../src/libpicasso.la -ldl - diff --git a/ext/image_loader/gif/Makefile.am b/ext/image_loader/gif/Makefile.am deleted file mode 100644 index f5bd771..0000000 --- a/ext/image_loader/gif/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -modulesdir=$(prefix)/lib/modules/ - -INCLUDES = -I../ \ - -I../../../ \ - -I../../../build \ - -I../../../include - -# picasso external system image module gif. -modules_LTLIBRARIES = libpsxm_image_gif.la - -libpsxm_image_gif_la_SOURCES = \ - gif_module.c \ - ../psx_image_io.c - -libpsxm_image_gif_la_LIBADD = -lgif -ldl - diff --git a/ext/image_loader/gif/gif.cmake b/ext/image_loader/gif/gif.cmake index a6bcd32..d6e85d6 100644 --- a/ext/image_loader/gif/gif.cmake +++ b/ext/image_loader/gif/gif.cmake @@ -11,11 +11,14 @@ set(PXGIF_SOURCES ${PXGIF_DIR}/gif_module.c ) +set(LIBX_GIF psxm_image_gif) + add_definitions(-DEXPORT) -add_library(psxm_image_gif ${PXGIF_SOURCES}) -target_link_libraries(psxm_image_gif PRIVATE gif) +add_library(${LIBX_GIF} ${PXGIF_SOURCES}) +target_link_libraries(${LIBX_GIF} PRIVATE gif) +install(TARGETS ${LIBX_GIF} LIBRARY DESTINATION lib/modules ARCHIVE DESTINATION lib/modules) -set_target_properties(psxm_image_gif +set_target_properties(${LIBX_GIF} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules" ) diff --git a/ext/image_loader/image.cmake b/ext/image_loader/image.cmake index 494313f..bb4e53e 100644 --- a/ext/image_loader/image.cmake +++ b/ext/image_loader/image.cmake @@ -15,6 +15,8 @@ set(PXIMG_SOURCES ${PXIMG_DIR}/psx_image_modules.c ) +set(LIBX_IMAGE psx_image) + if (WIN32) set(PXIMG_SOURCES ${PXIMG_SOURCES} @@ -25,10 +27,12 @@ if (WIN32) endif() add_definitions(-DEXPORT) -add_library(psx_image ${PXIMG_SOURCES}) +add_library(${LIBX_IMAGE} ${PXIMG_SOURCES}) +install(TARGETS ${LIBX_IMAGE} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) +set_target_properties(${LIBX_IMAGE} PROPERTIES VERSION ${VERSION_INFO} SOVERSION 1) include_directories(${PXIMG_DIR} ${PROJECT_ROOT}/include) -target_link_libraries(psx_image PRIVATE picasso2_sw) +target_link_libraries(psx_image PRIVATE ${LIB_NAME}) if (UNIX AND NOT APPLE) target_link_libraries(psx_image PUBLIC dl) diff --git a/ext/image_loader/jpeg/Makefile.am b/ext/image_loader/jpeg/Makefile.am deleted file mode 100644 index 305ec8b..0000000 --- a/ext/image_loader/jpeg/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -modulesdir=$(prefix)/lib/modules/ - -INCLUDES = -I../ \ - -I../../../ \ - -I../../../build \ - -I../../../include - -# picasso external system image module jpeg. -modules_LTLIBRARIES = libpsxm_image_jpeg.la - -libpsxm_image_jpeg_la_SOURCES = \ - jpeg_module.c \ - ../psx_image_io.c - -libpsxm_image_jpeg_la_LIBADD = -ljpeg -ldl - diff --git a/ext/image_loader/jpeg/jpeg.cmake b/ext/image_loader/jpeg/jpeg.cmake index 3e42cea..b7cec2e 100644 --- a/ext/image_loader/jpeg/jpeg.cmake +++ b/ext/image_loader/jpeg/jpeg.cmake @@ -11,11 +11,14 @@ set(PXJPEG_SOURCES ${PXJPEG_DIR}/jpeg_module.c ) +set(LIBX_JPEG psxm_image_jpeg) + add_definitions(-DEXPORT) -add_library(psxm_image_jpeg ${PXJPEG_SOURCES}) -target_link_libraries(psxm_image_jpeg PRIVATE jpeg) +add_library(${LIBX_JPEG} ${PXJPEG_SOURCES}) +target_link_libraries(${LIBX_JPEG} PRIVATE jpeg) +install(TARGETS ${LIBX_JPEG} LIBRARY DESTINATION lib/modules ARCHIVE DESTINATION lib/modules) -set_target_properties(psxm_image_jpeg +set_target_properties(${LIBX_JPEG} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules" ) diff --git a/ext/image_loader/png/Makefile.am b/ext/image_loader/png/Makefile.am deleted file mode 100644 index 853a3d3..0000000 --- a/ext/image_loader/png/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -modulesdir=$(prefix)/lib/modules/ - -INCLUDES = -I../ \ - -I../../../ \ - -I../../../build \ - -I../../../include - -# picasso external system image module png. -modules_LTLIBRARIES = libpsxm_image_png.la - -libpsxm_image_png_la_SOURCES = \ - png_module.c \ - ../psx_image_io.c - -libpsxm_image_png_la_LIBADD = -lpng -lz -ldl - diff --git a/ext/image_loader/png/png.cmake b/ext/image_loader/png/png.cmake index cc69cb8..658937f 100644 --- a/ext/image_loader/png/png.cmake +++ b/ext/image_loader/png/png.cmake @@ -11,11 +11,14 @@ set(PXPNG_SOURCES ${PXPNG_DIR}/png_module.c ) +set(LIBX_PNG psxm_image_png) + add_definitions(-DEXPORT) -add_library(psxm_image_png ${PXPNG_SOURCES}) -target_link_libraries(psxm_image_png PRIVATE png) +add_library(${LIBX_PNG} ${PXPNG_SOURCES}) +target_link_libraries(${LIBX_PNG} PRIVATE png) +install(TARGETS ${LIBX_PNG} LIBRARY DESTINATION lib/modules ARCHIVE DESTINATION lib/modules) -set_target_properties(psxm_image_png +set_target_properties(${LIBX_PNG} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules" ) diff --git a/ext/image_loader/webp/Makefile.am b/ext/image_loader/webp/Makefile.am deleted file mode 100644 index ed0d541..0000000 --- a/ext/image_loader/webp/Makefile.am +++ /dev/null @@ -1,16 +0,0 @@ -modulesdir=$(prefix)/lib/modules/ - -INCLUDES = -I../ \ - -I../../../ \ - -I../../../build \ - -I../../../include - -# picasso external system image module webp. -modules_LTLIBRARIES = libpsxm_image_webp.la - -libpsxm_image_webp_la_SOURCES = \ - webp_module.c \ - ../psx_image_io.c - -libpsxm_image_webp_la_LIBADD = -lwebp -ldl - diff --git a/ext/image_loader/webp/webp.cmake b/ext/image_loader/webp/webp.cmake index cf79bf6..0a2a1a5 100644 --- a/ext/image_loader/webp/webp.cmake +++ b/ext/image_loader/webp/webp.cmake @@ -11,11 +11,14 @@ set(PXWEBP_SOURCES ${PXWEBP_DIR}/webp_module.c ) +set(LIBX_WEBP psxm_image_webp) + add_definitions(-DEXPORT) -add_library(psxm_image_webp ${PXWEBP_SOURCES}) -target_link_libraries(psxm_image_webp PRIVATE webp) +add_library(${LIBX_WEBP} ${PXWEBP_SOURCES}) +target_link_libraries(${LIBX_WEBP} PRIVATE webp) +install(TARGETS ${LIBX_WEBP} LIBRARY DESTINATION lib/modules ARCHIVE DESTINATION lib/modules) -set_target_properties(psxm_image_webp +set_target_properties(${LIBX_WEBP} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/modules" ) diff --git a/include/Makefile.am b/include/Makefile.am deleted file mode 100644 index 2c92cfa..0000000 --- a/include/Makefile.am +++ /dev/null @@ -1 +0,0 @@ -include_HEADERS = picasso.h picasso_image.h picasso_image_plugin.h diff --git a/include/include.cmake b/include/include.cmake new file mode 100644 index 0000000..1c64fc6 --- /dev/null +++ b/include/include.cmake @@ -0,0 +1,10 @@ +# Picasso - a vector graphics library +# +# Copyright (C) 2024 Zhang Ji Peng +# Contact: onecoolx@gmail.com + +file(GLOB_RECURSE PICASSO_HEADERS ${PROJECT_ROOT}/include/*.h) + +install(FILES ${PICASSO_HEADERS} DESTINATION include/picasso) + + diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index d8487bd..0000000 --- a/src/Makefile.am +++ /dev/null @@ -1,116 +0,0 @@ -TOP_DIR=.. - -INCLUDES = -I./include \ - -I./gfx \ - -I./core \ - -I./simd \ - -I../include \ - -I../ - -VPATH=./ ./inclue ./core ./simd ./gfx - -lib_LTLIBRARIES = libpicasso.la - -AM_CFLAGS = -DEXPORT=1 -AM_CXXFLAGS = -DEXPORT=1 - -libpicasso_la_SOURCES= \ - include/color_type.h \ - include/common.h \ - include/convert.h \ - include/curve.h \ - include/clipper.h \ - include/data_vector.h \ - include/device.h \ - include/fastcopy.h \ - include/fixedopt.h \ - include/fastfill.h \ - include/geometry.h \ - include/graphic_base.h \ - include/graphic_helper.h \ - include/graphic_path.h \ - include/interfaces.h \ - include/math_type.h \ - include/memory_manager.h \ - include/platform.h \ - include/vertex.h \ - include/vertex_dist.h \ - include/matrix.h \ - \ - core/device.cpp \ - core/curve.cpp \ - core/clipper.cpp \ - core/graphic_path.cpp \ - core/matrix.cpp \ - \ - simd/fastcopy_sse.h \ - \ - gfx/gfx_blur.h \ - gfx/gfx_device.h \ - gfx/gfx_font_adapter.h \ - gfx/gfx_gamma_function.h \ - gfx/gfx_gradient_adapter.h \ - gfx/gfx_image_accessors.h \ - gfx/gfx_image_filters.h \ - gfx/gfx_line_generator.h \ - gfx/gfx_mask_layer.h \ - gfx/gfx_math.h \ - gfx/gfx_painter.h \ - gfx/gfx_painter_helper.h \ - gfx/gfx_pixfmt_rgb.h \ - gfx/gfx_pixfmt_rgb16.h \ - gfx/gfx_pixfmt_rgba.h \ - gfx/gfx_pixfmt_wrapper.h \ - gfx/gfx_raster_adapter.h \ - gfx/gfx_rasterizer_cell.h \ - gfx/gfx_rasterizer_scanline.h \ - gfx/gfx_renderer.h \ - gfx/gfx_rendering_buffer.h \ - gfx/gfx_scanline.h \ - gfx/gfx_scanline_renderer.h \ - gfx/gfx_scanline_storage.h \ - gfx/gfx_span_generator.h \ - gfx/gfx_span_image_filters.h \ - gfx/gfx_device.cpp \ - gfx/gfx_raster_adapter.cpp \ - gfx/gfx_gradient_adapter.cpp \ - gfx/gfx_image_filters.cpp \ - gfx/gfx_rendering_buffer.cpp \ - gfx/gfx_sqrt_tables.cpp \ - gfx/gfx_blur.cpp \ - gfx/gfx_font_adapter_win32.cpp \ - gfx/gfx_font_adapter_freetype2.cpp \ - gfx/gfx_font_load_freetype2.cpp \ - \ - picasso_font.h \ - picasso_font_cache.h \ - picasso_global.h \ - picasso_gradient.h \ - picasso_mask.h \ - picasso_objects.h \ - picasso_painter.h \ - picasso_private.h \ - picasso_raster_adapter.h \ - picasso_rendering_buffer.h \ - picasso_matrix_api.cpp \ - picasso_painter.cpp \ - picasso_rendering_buffer.cpp \ - picasso_raster_adapter.cpp \ - picasso_canvas.cpp \ - picasso_image.cpp \ - picasso_pattern.cpp \ - picasso_path.cpp \ - picasso_gradient.cpp \ - picasso_gradient_api.cpp \ - picasso_font.cpp \ - picasso_font_api.cpp \ - picasso_mask.cpp \ - picasso_mask_api.cpp \ - picasso_api.cpp - - -libpicasso_la_LDFLAGS= -no-undefined -release $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_MICRO) - -EXTRA_DIST = \ - simd/fastfill16_neon.S \ - simd/fastfill32_neon.S diff --git a/src/src.cmake b/src/src.cmake index aee05e1..6ddaf29 100644 --- a/src/src.cmake +++ b/src/src.cmake @@ -12,6 +12,8 @@ include_directories(${PROJECT_ROOT}/build ${PROJECT_ROOT}/src/gfx ${PROJECT_ROOT}/src/simd) +set(LIB_NAME picasso2_sw) + if (WIN32) set(SOURCES ${SOURCES} @@ -27,18 +29,21 @@ elseif (APPLE) endif() add_definitions(-DEXPORT) -add_library(picasso2_sw ${SOURCES}) +add_library(${LIB_NAME} ${SOURCES}) +install(TARGETS ${LIB_NAME} LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) if (UNIX AND NOT APPLE) find_package(Freetype REQUIRED) find_package(Fontconfig REQUIRED) - target_include_directories(picasso2_sw PRIVATE ${FREETYPE_INCLUDE_DIRS} ${FONTCONFIG_INCLUDE_DIRS}) - target_link_libraries(picasso2_sw PUBLIC Freetype::Freetype Fontconfig::Fontconfig) + set_target_properties(${LIB_NAME} PROPERTIES VERSION ${VERSION_INFO} SOVERSION 1) + target_include_directories(${LIB_NAME} PRIVATE ${FREETYPE_INCLUDE_DIRS} ${FONTCONFIG_INCLUDE_DIRS}) + target_link_libraries(${LIB_NAME} PUBLIC Freetype::Freetype Fontconfig::Fontconfig) elseif (APPLE) find_library(CORETEXT_LIBRARY CoreText) find_library(COREGRAPHICS_LIBRARY CoreGraphics) find_library(COREFOUNDATION_LIBRARY CoreFoundation) - target_link_libraries(picasso2_sw PUBLIC ${CORETEXT_LIBRARY} ${COREGRAPHICS_LIBRARY} ${COREFOUNDATION_LIBRARY}) + set_target_properties(${LIB_NAME} PROPERTIES VERSION ${VERSION_INFO} SOVERSION 1) + target_link_libraries(${LIB_NAME} PUBLIC ${CORETEXT_LIBRARY} ${COREGRAPHICS_LIBRARY} ${COREFOUNDATION_LIBRARY}) endif() diff --git a/test/Makefile.am b/test/Makefile.am deleted file mode 100644 index de5b314..0000000 --- a/test/Makefile.am +++ /dev/null @@ -1,36 +0,0 @@ -TOP_DIR=.. - -EXTRA_DIST = \ - drawFunc.h \ - timeuse.h \ - alpha_func.c \ - bitblt_func.c \ - blur_func.c \ - clip_func.c \ - composite_func.c \ - gamma_func.c \ - gcstate_func.c \ - gradient_func.c \ - mask_func.c \ - part_func.c \ - path_func.c \ - pattern_func.c \ - shadow_func.c \ - testGtk2.c \ - testWin.c \ - text_func.c \ - thr_posix.c \ - thr_win32.c \ - thread_func.c \ - testQt4.cpp \ - GNUmakefile.gtk2 \ - GNUmakefile.qt4 \ - font_config.cfg \ - pat.bmp \ - pat.png \ - pat565.bmp \ - selt2.bmp \ - selt2.png \ - selt2565.bmp \ - sung.ttf - diff --git a/third_party/giflib.cmake b/third_party/giflib.cmake index 71dbf53..253f70b 100644 --- a/third_party/giflib.cmake +++ b/third_party/giflib.cmake @@ -29,6 +29,7 @@ endif() configure_file(${GIF_DIR}/lib/gif_lib.h ${CMAKE_CURRENT_BINARY_DIR}/include/gif_lib.h) add_library(gif ${GIF_SOURCES}) +install(TARGETS gif LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) include_directories(${GIF_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include) diff --git a/third_party/libjpeg.cmake b/third_party/libjpeg.cmake index 8792fa9..1465bc9 100644 --- a/third_party/libjpeg.cmake +++ b/third_party/libjpeg.cmake @@ -76,6 +76,7 @@ configure_file(${JPEG_DIR}/jmorecfg.h ${CMAKE_CURRENT_BINARY_DIR}/include/jmorec configure_file(${JPEG_DIR}/jpeglib.h ${CMAKE_CURRENT_BINARY_DIR}/include/jpeglib.h) add_library(jpeg ${JPEG_SOURCES}) +install(TARGETS jpeg LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) include_directories(${JPEG_DIR} ${JPEG_DIR}/build ${JPEG_DIR}/simd ${CMAKE_CURRENT_BINARY_DIR}/include) diff --git a/third_party/libpng.cmake b/third_party/libpng.cmake index 46556b2..499c42e 100644 --- a/third_party/libpng.cmake +++ b/third_party/libpng.cmake @@ -29,6 +29,7 @@ configure_file(${PNG_DIR}/pngconf.h ${CMAKE_CURRENT_BINARY_DIR}/include/pngconf. configure_file(${PNG_DIR}/png.h ${CMAKE_CURRENT_BINARY_DIR}/include/png.h) add_library(png ${PNG_SOURCES}) +install(TARGETS png LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) include_directories(${PNG_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include) target_link_libraries(png PRIVATE zlib) diff --git a/third_party/libwebp.cmake b/third_party/libwebp.cmake index aac1739..7b7d2c5 100644 --- a/third_party/libwebp.cmake +++ b/third_party/libwebp.cmake @@ -167,6 +167,7 @@ foreach(webp_header ${WEBP_HEADERS}) endforeach(webp_header ${WEBP_HEADERS}) add_library(webp ${WEBP_SOURCES}) +install(TARGETS webp LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) include_directories(${WEBP_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include) diff --git a/third_party/zlib.cmake b/third_party/zlib.cmake index 3acc26a..8a22824 100644 --- a/third_party/zlib.cmake +++ b/third_party/zlib.cmake @@ -36,6 +36,7 @@ configure_file(${ZLIB_DIR}/zconf.h ${CMAKE_CURRENT_BINARY_DIR}/include/zconf.h) configure_file(${ZLIB_DIR}/zlib.h ${CMAKE_CURRENT_BINARY_DIR}/include/zlib.h) add_library(zlib ${ZLIB_SOURCES}) +install(TARGETS zlib LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) include_directories(${ZLIB_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include) diff --git a/tools/vs2008/README b/tools/vs2008/README deleted file mode 100644 index 5cc4b01..0000000 --- a/tools/vs2008/README +++ /dev/null @@ -1 +0,0 @@ -Copy stdint.h to /build/ , the project will be build successful on Visual Studio 2008. diff --git a/tools/vs2008/stdint.h b/tools/vs2008/stdint.h deleted file mode 100644 index f9d6eef..0000000 --- a/tools/vs2008/stdint.h +++ /dev/null @@ -1,176 +0,0 @@ -#ifndef _WIN32_STDINT_H -#define _WIN32_STDINT_H - -#if defined(_MSC_VER) && (_MSC_VER < 1600) -#include -#include - -/* 7.18.1.1 Exact-width integer types */ -#ifndef int8_t -typedef signed char int8_t; -#endif -#ifndef uint8_t -typedef unsigned char uint8_t; -#endif -typedef short int16_t; -typedef unsigned short uint16_t; -typedef int int32_t; -typedef unsigned uint32_t; - -#ifdef __GNUC__ -typedef long long int64_t; -typedef unsigned long long uint64_t; -#else -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; -#endif - -/* 7.18.1.2 Minimum-width integer types */ -typedef signed char int_least8_t; -typedef unsigned char uint_least8_t; -typedef short int_least16_t; -typedef unsigned short uint_least16_t; -typedef int int_least32_t; -typedef unsigned uint_least32_t; - -#ifdef __GNUC__ -typedef long long int_least64_t; -typedef unsigned long long uint_least64_t; -#else -typedef __int64 int_least64_t; -typedef unsigned __int64 uint_least64_t; -#endif - -/* 7.18.1.3 Fastest minimum-width integer types - * Not actually guaranteed to be fastest for all purposes - * Here we use the exact-width types for 8 and 16-bit ints. - */ -typedef char int_fast8_t; -typedef unsigned char uint_fast8_t; -typedef short int_fast16_t; -typedef unsigned short uint_fast16_t; -typedef int int_fast32_t; -typedef unsigned int uint_fast32_t; - -#ifdef __GNUC__ -typedef long long int_fast64_t; -typedef unsigned long long uint_fast64_t; -#else -typedef __int64 int_fast64_t; -typedef unsigned __int64 uint_fast64_t; -#endif - -/* 7.18.1.4 Integer types capable of holding object pointers */ -typedef int intptr_t; -typedef unsigned uintptr_t; - -/* 7.18.1.5 Greatest-width integer types */ -#ifdef __GNUC__ -typedef long long intmax_t; -typedef unsigned long long uintmax_t; -#else -typedef __int64 intmax_t; -typedef unsigned __int64 uintmax_t; -#endif - -/* 7.18.2 Limits of specified-width integer types */ -#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS) - -/* 7.18.2.1 Limits of exact-width integer types */ -#define INT8_MIN (-128) -#define INT16_MIN (-32768) -#define INT32_MIN (-2147483647 - 1) -#ifdef __GNUC__ -#define INT64_MIN (-9223372036854775807LL - 1) -#else -#define INT64_MIN (-9223372036854775807i64 - 1) -#endif - -#define INT8_MAX 127 -#define INT16_MAX 32767 -#define INT32_MAX 2147483647 -#ifdef __GNUC__ -#define INT64_MAX 9223372036854775807LL -#else -#define INT64_MAX 9223372036854775807i64 -#endif - -#define UINT8_MAX 0xff /* 255U */ -#define UINT16_MAX 0xffff /* 65535U */ -#define UINT32_MAX 0xffffffff /* 4294967295U */ -#ifdef __GNUC__ -#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */ -#else -#define UINT64_MAX 0xffffffffffffffffui64 /* 18446744073709551615ULL */ -#endif - -/* 7.18.2.2 Limits of minimum-width integer types */ -#define INT_LEAST8_MIN INT8_MIN -#define INT_LEAST16_MIN INT16_MIN -#define INT_LEAST32_MIN INT32_MIN -#define INT_LEAST64_MIN INT64_MIN - -#define INT_LEAST8_MAX INT8_MAX -#define INT_LEAST16_MAX INT16_MAX -#define INT_LEAST32_MAX INT32_MAX -#define INT_LEAST64_MAX INT64_MAX - -#define UINT_LEAST8_MAX UINT8_MAX -#define UINT_LEAST16_MAX UINT16_MAX -#define UINT_LEAST32_MAX UINT32_MAX -#define UINT_LEAST64_MAX UINT64_MAX - -/* 7.18.2.3 Limits of fastest minimum-width integer types */ -#define INT_FAST8_MIN INT8_MIN -#define INT_FAST16_MIN INT16_MIN -#define INT_FAST32_MIN INT32_MIN -#define INT_FAST64_MIN INT64_MIN - -#define INT_FAST8_MAX INT8_MAX -#define INT_FAST16_MAX INT16_MAX -#define INT_FAST32_MAX INT32_MAX -#define INT_FAST64_MAX INT64_MAX - -#define UINT_FAST8_MAX UINT8_MAX -#define UINT_FAST16_MAX UINT16_MAX -#define UINT_FAST32_MAX UINT32_MAX -#define UINT_FAST64_MAX UINT64_MAX - -/* 7.18.2.4 Limits of integer types capable of holding - object pointers */ -#define INTPTR_MIN INT32_MIN -#define INTPTR_MAX INT32_MAX -#define UINTPTR_MAX UINT32_MAX - -/* 7.18.2.5 Limits of greatest-width integer types */ -#define INTMAX_MIN INT64_MIN -#define INTMAX_MAX INT64_MAX -#define UINTMAX_MAX UINT64_MAX - -/* 7.18.3 Limits of other integer types */ -#define PTRDIFF_MIN INT32_MIN -#define PTRDIFF_MAX INT32_MAX - -#define SIG_ATOMIC_MIN INT32_MIN -#define SIG_ATOMIC_MAX INT32_MAX - -#ifndef SIZE_MAX -#define SIZE_MAX UINT32_MAX -#endif - -#ifndef WCHAR_MIN /* also in wchar.h */ -#define WCHAR_MIN 0 -#define WCHAR_MAX 0xffff /* UINT16_MAX */ -#endif - -/* - * wint_t is unsigned short for compatibility with MS runtime - */ -#define WINT_MIN 0 -#define WINT_MAX 0xffff /* UINT16_MAX */ - -#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */ - -#endif /*_MSC_VER*/ - -#endif //STDINT_H diff --git a/wasm/Makefile.em b/wasm/Makefile.em index d72a517..81a27d4 100644 --- a/wasm/Makefile.em +++ b/wasm/Makefile.em @@ -2,8 +2,6 @@ FREETYPE_INC=-I/usr/include/freetype2 INC=-I./ -I../src -I../src/gfx -I../src/include -I../include ${FREETYPE_INC} CXXFLAGS=-Wall -O3 -fno-rtti -fno-exceptions -#CXXFLAGS=-Wall -O3 -g -fprofile-arcs -ftest-coverage -fno-rtti -fno-exceptions -#CXXFLAGS=-Wall -O3 -g -pg -fno-rtti -fno-exceptions CXXFLAGS +=-DEXPORT VPATH=../src ../src/include ../src/core ../src/gfx