Skip to content

Commit

Permalink
feat: update libsdl2-image to 2.8.4+dfsg
Browse files Browse the repository at this point in the history
Signed-off-by: lhdjply <[email protected]>
  • Loading branch information
lhdjply authored and Zeno-sole committed Jan 20, 2025
1 parent 6e3bf30 commit ea8074d
Show file tree
Hide file tree
Showing 154 changed files with 26,997 additions and 44,607 deletions.
1 change: 1 addition & 0 deletions .git-hash
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4641fd73853a60a448a2f352a865633bec6140e8
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

32 changes: 32 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[submodule "external/jpeg"]
path = external/jpeg
url = https://github.com/libsdl-org/jpeg.git
branch = v9f-SDL
[submodule "external/libpng"]
path = external/libpng
url = https://github.com/libsdl-org/libpng.git
branch = v1.6.43-SDL
[submodule "external/libwebp"]
path = external/libwebp
url = https://github.com/libsdl-org/libwebp.git
branch = 1.0.3-SDL
[submodule "external/libtiff"]
path = external/libtiff
url = https://github.com/libsdl-org/libtiff.git
branch = v4.2.0-SDL
[submodule "external/zlib"]
path = external/zlib
url = https://github.com/libsdl-org/zlib.git
branch = v1.3.1-SDL
[submodule "external/libjxl"]
path = external/libjxl
url = https://github.com/libsdl-org/libjxl.git
branch = v0.6.1-SDL
[submodule "external/libavif"]
path = external/libavif
url = https://github.com/libsdl-org/libavif.git
branch = v1.0.4-SDL
[submodule "external/dav1d"]
path = external/dav1d
url = https://github.com/libsdl-org/dav1d.git
branch = 1.2.1-SDL
16 changes: 16 additions & 0 deletions .wikiheaders-options
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
projectfullname = SDL_image
projectshortname = SDL_image
incsubdir =
wikisubdir = SDL_image
apiprefixregex = IMG_
mainincludefname = SDL_image.h
versionfname = SDL_image.h
versionmajorregex = \A\#define\s+SDL_IMAGE_MAJOR_VERSION\s+(\d+)\Z
versionminorregex = \A\#define\s+SDL_IMAGE_MINOR_VERSION\s+(\d+)\Z
versionpatchregex = \A\#define\s+SDL_IMAGE_PATCHLEVEL\s+(\d+)\Z
selectheaderregex = \ASDL_image\.h\Z
projecturl = https://libsdl.org/projects/SDL_image
wikiurl = https://wiki.libsdl.org/SDL_image
bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new
warn_about_missing = 1
wikipreamble = (This function is part of SDL_image, a separate library from SDL.)
141 changes: 111 additions & 30 deletions Android.mk
Original file line number Diff line number Diff line change
@@ -1,27 +1,57 @@
SDL_IMAGE_LOCAL_PATH := $(call my-dir)


# Enable this if you want to support loading JPEG images
# Enable this if you want PNG and JPG support with minimal dependencies
USE_STBIMAGE ?= true

# The additional formats below require downloading third party dependencies,
# using the external/download.sh script.

# Enable this if you want to support loading AVIF images
# The library path should be a relative path to this directory.
SUPPORT_AVIF ?= false
AVIF_LIBRARY_PATH := external/libavif
DAV1D_LIBRARY_PATH := external/dav1d

# Enable this if you want to support loading JPEG images using libjpeg
# The library path should be a relative path to this directory.
SUPPORT_JPG ?= true
JPG_LIBRARY_PATH := external/jpeg-9b
SUPPORT_JPG ?= false
SUPPORT_SAVE_JPG ?= true
JPG_LIBRARY_PATH := external/jpeg

# Enable this if you want to support loading PNG images
# Enable this if you want to support loading JPEG-XL images
# The library path should be a relative path to this directory.
SUPPORT_PNG ?= true
PNG_LIBRARY_PATH := external/libpng-1.6.37
SUPPORT_JXL ?= false
JXL_LIBRARY_PATH := external/libjxl

# Enable this if you want to support loading PNG images using libpng
# The library path should be a relative path to this directory.
SUPPORT_PNG ?= false
SUPPORT_SAVE_PNG ?= true
PNG_LIBRARY_PATH := external/libpng

# Enable this if you want to support loading WebP images
# The library path should be a relative path to this directory.
SUPPORT_WEBP ?= true
WEBP_LIBRARY_PATH := external/libwebp-1.0.2
SUPPORT_WEBP ?= false
WEBP_LIBRARY_PATH := external/libwebp


# Build the library
ifeq ($(SUPPORT_AVIF),true)
include $(SDL_IMAGE_LOCAL_PATH)/$(AVIF_LIBRARY_PATH)/Android.mk
include $(SDL_IMAGE_LOCAL_PATH)/$(DAV1D_LIBRARY_PATH)/Android.mk
endif

# Build the library
ifeq ($(SUPPORT_JPG),true)
include $(SDL_IMAGE_LOCAL_PATH)/$(JPG_LIBRARY_PATH)/Android.mk
endif

# Build the library
ifeq ($(SUPPORT_JXL),true)
include $(SDL_IMAGE_LOCAL_PATH)/$(JXL_LIBRARY_PATH)/Android.mk
endif

# Build the library
ifeq ($(SUPPORT_PNG),true)
include $(SDL_IMAGE_LOCAL_PATH)/$(PNG_LIBRARY_PATH)/Android.mk
Expand All @@ -41,49 +71,100 @@ include $(CLEAR_VARS)
LOCAL_MODULE := SDL2_image

LOCAL_SRC_FILES := \
IMG.c \
IMG_bmp.c \
IMG_gif.c \
IMG_jpg.c \
IMG_lbm.c \
IMG_pcx.c \
IMG_png.c \
IMG_pnm.c \
IMG_svg.c \
IMG_tga.c \
IMG_tif.c \
IMG_webp.c \
IMG_WIC.c \
IMG_xcf.c \
IMG_xpm.c.arm \
IMG_xv.c \
IMG_xxx.c

src/IMG.c \
src/IMG_avif.c \
src/IMG_bmp.c \
src/IMG_gif.c \
src/IMG_jpg.c \
src/IMG_jxl.c \
src/IMG_lbm.c \
src/IMG_pcx.c \
src/IMG_png.c \
src/IMG_pnm.c \
src/IMG_qoi.c \
src/IMG_stb.c \
src/IMG_svg.c \
src/IMG_tga.c \
src/IMG_tif.c \
src/IMG_webp.c \
src/IMG_WIC.c \
src/IMG_xcf.c \
src/IMG_xpm.c.arm \
src/IMG_xv.c

LOCAL_C_INCLUDES += $(LOCAL_PATH)/include
LOCAL_CFLAGS := -DLOAD_BMP -DLOAD_GIF -DLOAD_LBM -DLOAD_PCX -DLOAD_PNM \
-DLOAD_SVG -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM -DLOAD_XV
-DLOAD_SVG -DLOAD_TGA -DLOAD_XCF -DLOAD_XPM -DLOAD_XV \
-DLOAD_QOI
LOCAL_LDLIBS :=
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES := SDL2

ifeq ($(USE_STBIMAGE),true)
LOCAL_CFLAGS += -DLOAD_JPG -DLOAD_PNG -DUSE_STBIMAGE
endif

ifeq ($(SUPPORT_AVIF),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(AVIF_LIBRARY_PATH)/include
LOCAL_CFLAGS += -DLOAD_AVIF
LOCAL_STATIC_LIBRARIES += avif
LOCAL_WHOLE_STATIC_LIBRARIES += dav1d dav1d-8bit dav1d-16bit
endif

ifeq ($(SUPPORT_JPG),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(JPG_LIBRARY_PATH)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(JPG_LIBRARY_PATH) \
$(LOCAL_PATH)/$(JPG_LIBRARY_PATH)/android
LOCAL_CFLAGS += -DLOAD_JPG
LOCAL_STATIC_LIBRARIES += jpeg
ifeq ($(SUPPORT_SAVE_JPG),true)
LOCAL_CFLAGS += -DSDL_IMAGE_SAVE_JPG=1
else
LOCAL_CFLAGS += -DSDL_IMAGE_SAVE_JPG=0
endif
endif

ifeq ($(SUPPORT_JXL),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(JXL_LIBRARY_PATH)/lib/include \
$(LOCAL_PATH)/$(JXL_LIBRARY_PATH)/android
LOCAL_CFLAGS += -DLOAD_JXL
LOCAL_STATIC_LIBRARIES += jxl
endif

ifeq ($(SUPPORT_PNG),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(PNG_LIBRARY_PATH)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(PNG_LIBRARY_PATH) \
$(LOCAL_PATH)/$(PNG_LIBRARY_PATH)/android
LOCAL_CFLAGS += -DLOAD_PNG
LOCAL_STATIC_LIBRARIES += png
LOCAL_LDLIBS += -lz
ifeq ($(SUPPORT_SAVE_PNG),true)
LOCAL_CFLAGS += -DSDL_IMAGE_SAVE_PNG=1
else
LOCAL_CFLAGS += -DSDL_IMAGE_SAVE_PNG=0
endif
endif

ifeq ($(SUPPORT_WEBP),true)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(WEBP_LIBRARY_PATH)/src
LOCAL_CFLAGS += -DLOAD_WEBP
LOCAL_STATIC_LIBRARIES += webpdemux
LOCAL_STATIC_LIBRARIES += webp
endif

LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)
LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/include

include $(BUILD_SHARED_LIBRARY)

###########################
#
# SDL2_image static library
#
###########################

LOCAL_MODULE := SDL2_image_static

LOCAL_MODULE_FILENAME := libSDL2_image

LOCAL_LDLIBS :=
LOCAL_EXPORT_LDLIBS :=

include $(BUILD_STATIC_LIBRARY)
27 changes: 27 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
2.8.0:
* Added support for loading WEBP animations
* PNG images with a palette are loaded as SDL surfaces with a palette

2.6.3:
* Fixed loading of 4-bit .ico files

2.6.2:
* Updated autotools to use ax_compute_relative_paths, fixing homebrew on macOS

2.6.1:
* Fixed loading grayscale PNGs when using stb_image

2.6.0:
* Added support for building with CMake
* Added stb_image as the default backend for JPG and PNG images loading.
To use libpng and libjpg instead, configure using --disable-stb-image
* Added IMG_LoadSizedSVG_RW()
* Added support for AVIF images (https://github.com/AOMediaCodec/libavif)
* Added IMG_ReadXPMFromArrayToRGB888()
* Added support for JXL images (https://jpegxl.info/)
* Added support for QOI images (https://qoiformat.org/)
* Fixed XCF regression introduced in 2.0.5
* Added support for loading animated GIFs
* LoadBMP() now loads files using SDL2
* Allow using libwebpdecoder instead libwebp

2.0.5:
Sam Lantinga - Wed Jun 19 07:30:51 PDT 2019
* Updated external libraries libpng-1.6.32, libwebp-1.0.2
Expand Down
Loading

0 comments on commit ea8074d

Please sign in to comment.