Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/libsdl-org/SDL_image
Image decoding for many popular formats for Simple Directmedia Layer.
https://github.com/libsdl-org/SDL_image
sdl-image sdl2
Last synced: 3 months ago
JSON representation
Image decoding for many popular formats for Simple Directmedia Layer.
- Host: GitHub
- URL: https://github.com/libsdl-org/SDL_image
- Owner: libsdl-org
- License: zlib
- Created: 2021-01-21T04:48:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T01:26:21.000Z (3 months ago)
- Last Synced: 2024-10-17T14:15:40.109Z (3 months ago)
- Topics: sdl-image, sdl2
- Language: C
- Homepage:
- Size: 92.6 MB
- Stars: 565
- Watchers: 23
- Forks: 184
- Open Issues: 25
-
Metadata Files:
- Readme: README.txt
- Changelog: CHANGES.txt
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-sdl - SDL_image
README
SDL_image 3.0
The latest version of this library is available from GitHub:
https://github.com/libsdl-org/SDL_image/releasesThis is a simple library to load images of various formats as SDL surfaces.
It can load BMP, GIF, JPEG, LBM, PCX, PNG, PNM (PPM/PGM/PBM), QOI, TGA, XCF, XPM, and simple SVG format images. It can also load AVIF, JPEG-XL, TIFF, and WebP images, depending on build options (see the note below for details.)API:
#includeSDL_Surface *IMG_Load(const char *file);
or
SDL_Surface *IMG_Load_IO(SDL_IOStream *src, SDL_bool closeio);
or
SDL_Surface *IMG_LoadTyped_IO(SDL_IOStream *src, SDL_bool closeio, char *type);where type is a string specifying the format (i.e. "PNG" or "pcx").
Note that IMG_Load_IO cannot load TGA images.To create a surface from an XPM image included in C source, use:
SDL_Surface *IMG_ReadXPMFromArray(char **xpm);
An example program 'showimage' is included, with source in examples/showimage.c
Documentation is also available online at https://wiki.libsdl.org/SDL_image
This library is under the zlib License, see the file "LICENSE.txt" for details.
Note:
Support for AVIF, JPEG-XL, TIFF, and WebP are not included by default because of the size of the decode libraries, but you can get them by running external/download.sh
- When building with CMake, you can enable the appropriate SDLIMAGE_* options defined in CMakeLists.txt. SDLIMAGE_VENDORED allows switching between system and vendored libraries.
- When building with configure/make, you can build and install them normally and the configure script will detect and use them.
- When building with Visual Studio, you will need to build the libraries and then add the appropriate LOAD_* preprocessor define to the Visual Studio project.
- When building with Xcode, you can edit the config at the top of the project to enable them, and you will need to include the appropriate framework in your application.
- For Android, you can edit the config at the top of Android.mk to enable them.