native_audio 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/assets/include/GL/glew.h +26427 -0
- data/assets/include/GLES2/gl2.h +656 -0
- data/assets/include/GLES2/gl2ext.h +3949 -0
- data/assets/include/GLES2/gl2ext_angle.h +701 -0
- data/assets/include/GLES2/gl2platform.h +27 -0
- data/assets/include/GLES3/gl3.h +1192 -0
- data/assets/include/GLES3/gl31.h +1507 -0
- data/assets/include/GLES3/gl32.h +1808 -0
- data/assets/include/GLES3/gl3platform.h +27 -0
- data/assets/include/KHR/khrplatform.h +290 -0
- data/assets/include/SDL2/SDL.h +233 -0
- data/assets/include/SDL2/SDL_assert.h +326 -0
- data/assets/include/SDL2/SDL_atomic.h +415 -0
- data/assets/include/SDL2/SDL_audio.h +1500 -0
- data/assets/include/SDL2/SDL_bits.h +126 -0
- data/assets/include/SDL2/SDL_blendmode.h +198 -0
- data/assets/include/SDL2/SDL_clipboard.h +141 -0
- data/assets/include/SDL2/SDL_config.h +61 -0
- data/assets/include/SDL2/SDL_config_android.h +194 -0
- data/assets/include/SDL2/SDL_config_emscripten.h +218 -0
- data/assets/include/SDL2/SDL_config_iphoneos.h +217 -0
- data/assets/include/SDL2/SDL_config_macosx.h +277 -0
- data/assets/include/SDL2/SDL_config_minimal.h +95 -0
- data/assets/include/SDL2/SDL_config_ngage.h +89 -0
- data/assets/include/SDL2/SDL_config_os2.h +207 -0
- data/assets/include/SDL2/SDL_config_pandora.h +141 -0
- data/assets/include/SDL2/SDL_config_windows.h +331 -0
- data/assets/include/SDL2/SDL_config_wingdk.h +253 -0
- data/assets/include/SDL2/SDL_config_winrt.h +220 -0
- data/assets/include/SDL2/SDL_config_xbox.h +235 -0
- data/assets/include/SDL2/SDL_copying.h +20 -0
- data/assets/include/SDL2/SDL_cpuinfo.h +594 -0
- data/assets/include/SDL2/SDL_egl.h +2352 -0
- data/assets/include/SDL2/SDL_endian.h +348 -0
- data/assets/include/SDL2/SDL_error.h +163 -0
- data/assets/include/SDL2/SDL_events.h +1166 -0
- data/assets/include/SDL2/SDL_filesystem.h +149 -0
- data/assets/include/SDL2/SDL_gamecontroller.h +1074 -0
- data/assets/include/SDL2/SDL_gesture.h +117 -0
- data/assets/include/SDL2/SDL_guid.h +100 -0
- data/assets/include/SDL2/SDL_haptic.h +1341 -0
- data/assets/include/SDL2/SDL_hidapi.h +451 -0
- data/assets/include/SDL2/SDL_hints.h +2569 -0
- data/assets/include/SDL2/SDL_image.h +2173 -0
- data/assets/include/SDL2/SDL_joystick.h +1066 -0
- data/assets/include/SDL2/SDL_keyboard.h +353 -0
- data/assets/include/SDL2/SDL_keycode.h +358 -0
- data/assets/include/SDL2/SDL_loadso.h +115 -0
- data/assets/include/SDL2/SDL_locale.h +103 -0
- data/assets/include/SDL2/SDL_log.h +404 -0
- data/assets/include/SDL2/SDL_main.h +275 -0
- data/assets/include/SDL2/SDL_messagebox.h +193 -0
- data/assets/include/SDL2/SDL_metal.h +113 -0
- data/assets/include/SDL2/SDL_misc.h +79 -0
- data/assets/include/SDL2/SDL_mixer.h +2784 -0
- data/assets/include/SDL2/SDL_mouse.h +465 -0
- data/assets/include/SDL2/SDL_mutex.h +471 -0
- data/assets/include/SDL2/SDL_name.h +33 -0
- data/assets/include/SDL2/SDL_opengl.h +2132 -0
- data/assets/include/SDL2/SDL_opengl_glext.h +13209 -0
- data/assets/include/SDL2/SDL_opengles.h +39 -0
- data/assets/include/SDL2/SDL_opengles2.h +52 -0
- data/assets/include/SDL2/SDL_opengles2_gl2.h +656 -0
- data/assets/include/SDL2/SDL_opengles2_gl2ext.h +4033 -0
- data/assets/include/SDL2/SDL_opengles2_gl2platform.h +27 -0
- data/assets/include/SDL2/SDL_opengles2_khrplatform.h +311 -0
- data/assets/include/SDL2/SDL_pixels.h +644 -0
- data/assets/include/SDL2/SDL_platform.h +261 -0
- data/assets/include/SDL2/SDL_power.h +88 -0
- data/assets/include/SDL2/SDL_quit.h +58 -0
- data/assets/include/SDL2/SDL_rect.h +376 -0
- data/assets/include/SDL2/SDL_render.h +1919 -0
- data/assets/include/SDL2/SDL_revision.h +6 -0
- data/assets/include/SDL2/SDL_rwops.h +841 -0
- data/assets/include/SDL2/SDL_scancode.h +438 -0
- data/assets/include/SDL2/SDL_sensor.h +322 -0
- data/assets/include/SDL2/SDL_shape.h +155 -0
- data/assets/include/SDL2/SDL_stdinc.h +830 -0
- data/assets/include/SDL2/SDL_surface.h +997 -0
- data/assets/include/SDL2/SDL_system.h +623 -0
- data/assets/include/SDL2/SDL_syswm.h +386 -0
- data/assets/include/SDL2/SDL_test.h +69 -0
- data/assets/include/SDL2/SDL_test_assert.h +105 -0
- data/assets/include/SDL2/SDL_test_common.h +236 -0
- data/assets/include/SDL2/SDL_test_compare.h +69 -0
- data/assets/include/SDL2/SDL_test_crc32.h +124 -0
- data/assets/include/SDL2/SDL_test_font.h +168 -0
- data/assets/include/SDL2/SDL_test_fuzzer.h +386 -0
- data/assets/include/SDL2/SDL_test_harness.h +134 -0
- data/assets/include/SDL2/SDL_test_images.h +78 -0
- data/assets/include/SDL2/SDL_test_log.h +67 -0
- data/assets/include/SDL2/SDL_test_md5.h +129 -0
- data/assets/include/SDL2/SDL_test_memory.h +63 -0
- data/assets/include/SDL2/SDL_test_random.h +115 -0
- data/assets/include/SDL2/SDL_thread.h +464 -0
- data/assets/include/SDL2/SDL_timer.h +222 -0
- data/assets/include/SDL2/SDL_touch.h +150 -0
- data/assets/include/SDL2/SDL_ttf.h +2316 -0
- data/assets/include/SDL2/SDL_types.h +29 -0
- data/assets/include/SDL2/SDL_version.h +204 -0
- data/assets/include/SDL2/SDL_video.h +2150 -0
- data/assets/include/SDL2/SDL_vulkan.h +215 -0
- data/assets/include/SDL2/begin_code.h +187 -0
- data/assets/include/SDL2/close_code.h +40 -0
- data/assets/macos/universal/lib/libFLAC.a +0 -0
- data/assets/macos/universal/lib/libSDL2.a +0 -0
- data/assets/macos/universal/lib/libSDL2_image.a +0 -0
- data/assets/macos/universal/lib/libSDL2_mixer.a +0 -0
- data/assets/macos/universal/lib/libSDL2_ttf.a +0 -0
- data/assets/macos/universal/lib/libmodplug.a +0 -0
- data/assets/macos/universal/lib/libmpg123.a +0 -0
- data/assets/macos/universal/lib/libogg.a +0 -0
- data/assets/macos/universal/lib/libvorbis.a +0 -0
- data/assets/macos/universal/lib/libvorbisfile.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libFLAC.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libSDL2_mixer.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libglew32.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmodplug.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libmpg123.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libogg.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopus.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libopusfile.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libsndfile.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libssp.a +1 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libstdc++.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbis.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libvorbisfile.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libz.a +0 -0
- data/assets/windows/mingw-w64-ucrt-x86_64/lib/libzstd.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libFLAC.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libSDL2_mixer.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libglew32.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmodplug.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libmpg123.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libogg.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libopus.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libopusfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libsndfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libssp.a +1 -0
- data/assets/windows/mingw-w64-x86_64/lib/libstdc++.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libvorbis.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libvorbisfile.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libz.a +0 -0
- data/assets/windows/mingw-w64-x86_64/lib/libzstd.a +0 -0
- data/ext/Makefile +270 -0
- data/ext/audio.c +80 -0
- data/ext/audio.o +0 -0
- data/ext/extconf.h +3 -0
- data/ext/extconf.rb +177 -0
- data/ext/mkmf.log +7 -0
- data/lib/audio.bundle +0 -0
- data/lib/native_audio.rb +50 -0
- metadata +198 -0
@@ -0,0 +1,2173 @@
|
|
1
|
+
/*
|
2
|
+
SDL_image: An example image loading library for use with SDL
|
3
|
+
Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
|
4
|
+
|
5
|
+
This software is provided 'as-is', without any express or implied
|
6
|
+
warranty. In no event will the authors be held liable for any damages
|
7
|
+
arising from the use of this software.
|
8
|
+
|
9
|
+
Permission is granted to anyone to use this software for any purpose,
|
10
|
+
including commercial applications, and to alter it and redistribute it
|
11
|
+
freely, subject to the following restrictions:
|
12
|
+
|
13
|
+
1. The origin of this software must not be misrepresented; you must not
|
14
|
+
claim that you wrote the original software. If you use this software
|
15
|
+
in a product, an acknowledgment in the product documentation would be
|
16
|
+
appreciated but is not required.
|
17
|
+
2. Altered source versions must be plainly marked as such, and must not be
|
18
|
+
misrepresented as being the original software.
|
19
|
+
3. This notice may not be removed or altered from any source distribution.
|
20
|
+
*/
|
21
|
+
|
22
|
+
/**
|
23
|
+
* \file SDL_image.h
|
24
|
+
*
|
25
|
+
* Header file for SDL_image library
|
26
|
+
*
|
27
|
+
* A simple library to load images of various formats as SDL surfaces
|
28
|
+
*/
|
29
|
+
#ifndef SDL_IMAGE_H_
|
30
|
+
#define SDL_IMAGE_H_
|
31
|
+
|
32
|
+
#include "SDL.h"
|
33
|
+
#include "SDL_version.h"
|
34
|
+
#include "begin_code.h"
|
35
|
+
|
36
|
+
/* Set up for C function definitions, even when using C++ */
|
37
|
+
#ifdef __cplusplus
|
38
|
+
extern "C" {
|
39
|
+
#endif
|
40
|
+
|
41
|
+
/**
|
42
|
+
* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL
|
43
|
+
*/
|
44
|
+
#define SDL_IMAGE_MAJOR_VERSION 2
|
45
|
+
#define SDL_IMAGE_MINOR_VERSION 6
|
46
|
+
#define SDL_IMAGE_PATCHLEVEL 2
|
47
|
+
|
48
|
+
/**
|
49
|
+
* This macro can be used to fill a version structure with the compile-time
|
50
|
+
* version of the SDL_image library.
|
51
|
+
*/
|
52
|
+
#define SDL_IMAGE_VERSION(X) \
|
53
|
+
{ \
|
54
|
+
(X)->major = SDL_IMAGE_MAJOR_VERSION; \
|
55
|
+
(X)->minor = SDL_IMAGE_MINOR_VERSION; \
|
56
|
+
(X)->patch = SDL_IMAGE_PATCHLEVEL; \
|
57
|
+
}
|
58
|
+
|
59
|
+
#if SDL_IMAGE_MAJOR_VERSION < 3 && SDL_MAJOR_VERSION < 3
|
60
|
+
/**
|
61
|
+
* This is the version number macro for the current SDL_image version.
|
62
|
+
*
|
63
|
+
* In versions higher than 2.9.0, the minor version overflows into
|
64
|
+
* the thousands digit: for example, 2.23.0 is encoded as 4300.
|
65
|
+
* This macro will not be available in SDL 3.x or SDL_image 3.x.
|
66
|
+
*
|
67
|
+
* Deprecated, use SDL_IMAGE_VERSION_ATLEAST or SDL_IMAGE_VERSION instead.
|
68
|
+
*/
|
69
|
+
#define SDL_IMAGE_COMPILEDVERSION \
|
70
|
+
SDL_VERSIONNUM(SDL_IMAGE_MAJOR_VERSION, SDL_IMAGE_MINOR_VERSION, SDL_IMAGE_PATCHLEVEL)
|
71
|
+
#endif /* SDL_IMAGE_MAJOR_VERSION < 3 && SDL_MAJOR_VERSION < 3 */
|
72
|
+
|
73
|
+
/**
|
74
|
+
* This macro will evaluate to true if compiled with SDL_image at least X.Y.Z.
|
75
|
+
*/
|
76
|
+
#define SDL_IMAGE_VERSION_ATLEAST(X, Y, Z) \
|
77
|
+
((SDL_IMAGE_MAJOR_VERSION >= X) && \
|
78
|
+
(SDL_IMAGE_MAJOR_VERSION > X || SDL_IMAGE_MINOR_VERSION >= Y) && \
|
79
|
+
(SDL_IMAGE_MAJOR_VERSION > X || SDL_IMAGE_MINOR_VERSION > Y || SDL_IMAGE_PATCHLEVEL >= Z))
|
80
|
+
|
81
|
+
/**
|
82
|
+
* This function gets the version of the dynamically linked SDL_image library.
|
83
|
+
*
|
84
|
+
* it should NOT be used to fill a version structure, instead you should use
|
85
|
+
* the SDL_IMAGE_VERSION() macro.
|
86
|
+
*
|
87
|
+
* \returns SDL_image version
|
88
|
+
*/
|
89
|
+
extern DECLSPEC const SDL_version * SDLCALL IMG_Linked_Version(void);
|
90
|
+
|
91
|
+
/**
|
92
|
+
* Initialization flags
|
93
|
+
*/
|
94
|
+
typedef enum
|
95
|
+
{
|
96
|
+
IMG_INIT_JPG = 0x00000001,
|
97
|
+
IMG_INIT_PNG = 0x00000002,
|
98
|
+
IMG_INIT_TIF = 0x00000004,
|
99
|
+
IMG_INIT_WEBP = 0x00000008,
|
100
|
+
IMG_INIT_JXL = 0x00000010,
|
101
|
+
IMG_INIT_AVIF = 0x00000020
|
102
|
+
} IMG_InitFlags;
|
103
|
+
|
104
|
+
/**
|
105
|
+
* Initialize SDL_image.
|
106
|
+
*
|
107
|
+
* This function loads dynamic libraries that SDL_image needs, and prepares
|
108
|
+
* them for use. This must be the first function you call in SDL_image, and if
|
109
|
+
* it fails you should not continue with the library.
|
110
|
+
*
|
111
|
+
* Flags should be one or more flags from IMG_InitFlags OR'd together. It
|
112
|
+
* returns the flags successfully initialized, or 0 on failure.
|
113
|
+
*
|
114
|
+
* Currently, these flags are:
|
115
|
+
*
|
116
|
+
* - `_INIT_JPG`
|
117
|
+
* - `_INIT_PNG`
|
118
|
+
* - `_INIT_TIF`
|
119
|
+
* - `_INIT_WEBP`
|
120
|
+
* - `_INIT_JXL`
|
121
|
+
* - `_INIT_AVIF`
|
122
|
+
*
|
123
|
+
* More flags may be added in a future SDL_image release.
|
124
|
+
*
|
125
|
+
* This function may need to load external shared libraries to support various
|
126
|
+
* codecs, which means this function can fail to initialize that support on an
|
127
|
+
* otherwise-reasonable system if the library isn't available; this is not
|
128
|
+
* just a question of exceptional circumstances like running out of memory at
|
129
|
+
* startup!
|
130
|
+
*
|
131
|
+
* Note that you may call this function more than once to initialize with
|
132
|
+
* additional flags. The return value will reflect both new flags that
|
133
|
+
* successfully initialized, and also include flags that had previously been
|
134
|
+
* initialized as well.
|
135
|
+
*
|
136
|
+
* As this will return previously-initialized flags, it's legal to call this
|
137
|
+
* with zero (no flags set). This is a safe no-op that can be used to query
|
138
|
+
* the current initialization state without changing it at all.
|
139
|
+
*
|
140
|
+
* Since this returns previously-initialized flags as well as new ones, and
|
141
|
+
* you can call this with zero, you should not check for a zero return value
|
142
|
+
* to determine an error condition. Instead, you should check to make sure all
|
143
|
+
* the flags you require are set in the return value. If you have a game with
|
144
|
+
* data in a specific format, this might be a fatal error. If you're a generic
|
145
|
+
* image displaying app, perhaps you are fine with only having JPG and PNG
|
146
|
+
* support and can live without WEBP, even if you request support for
|
147
|
+
* everything.
|
148
|
+
*
|
149
|
+
* Unlike other SDL satellite libraries, calls to IMG_Init do not stack; a
|
150
|
+
* single call to IMG_Quit() will deinitialize everything and does not have to
|
151
|
+
* be paired with a matching IMG_Init call. For that reason, it's considered
|
152
|
+
* best practices to have a single IMG_Init and IMG_Quit call in your program.
|
153
|
+
* While this isn't required, be aware of the risks of deviating from that
|
154
|
+
* behavior.
|
155
|
+
*
|
156
|
+
* After initializing SDL_image, the app may begin to load images into
|
157
|
+
* SDL_Surfaces or SDL_Textures.
|
158
|
+
*
|
159
|
+
* \param flags initialization flags, OR'd together.
|
160
|
+
* \returns all currently initialized flags.
|
161
|
+
*
|
162
|
+
* \since This function is available since SDL_image 2.0.0.
|
163
|
+
*
|
164
|
+
* \sa IMG_Quit
|
165
|
+
*/
|
166
|
+
extern DECLSPEC int SDLCALL IMG_Init(int flags);
|
167
|
+
|
168
|
+
/**
|
169
|
+
* Deinitialize SDL_image.
|
170
|
+
*
|
171
|
+
* This should be the last function you call in SDL_image, after freeing all
|
172
|
+
* other resources. This will unload any shared libraries it is using for
|
173
|
+
* various codecs.
|
174
|
+
*
|
175
|
+
* After this call, a call to IMG_Init(0) will return 0 (no codecs loaded).
|
176
|
+
*
|
177
|
+
* You can safely call IMG_Init() to reload various codec support after this
|
178
|
+
* call.
|
179
|
+
*
|
180
|
+
* Unlike other SDL satellite libraries, calls to IMG_Init do not stack; a
|
181
|
+
* single call to IMG_Quit() will deinitialize everything and does not have to
|
182
|
+
* be paired with a matching IMG_Init call. For that reason, it's considered
|
183
|
+
* best practices to have a single IMG_Init and IMG_Quit call in your program.
|
184
|
+
* While this isn't required, be aware of the risks of deviating from that
|
185
|
+
* behavior.
|
186
|
+
*
|
187
|
+
* \since This function is available since SDL_image 2.0.0.
|
188
|
+
*
|
189
|
+
* \sa IMG_Init
|
190
|
+
*/
|
191
|
+
extern DECLSPEC void SDLCALL IMG_Quit(void);
|
192
|
+
|
193
|
+
/**
|
194
|
+
* Load an image from an SDL data source into a software surface.
|
195
|
+
*
|
196
|
+
* An SDL_Surface is a buffer of pixels in memory accessible by the CPU. Use
|
197
|
+
* this if you plan to hand the data to something else or manipulate it
|
198
|
+
* further in code.
|
199
|
+
*
|
200
|
+
* There are no guarantees about what format the new SDL_Surface data will be;
|
201
|
+
* in many cases, SDL_image will attempt to supply a surface that exactly
|
202
|
+
* matches the provided image, but in others it might have to convert (either
|
203
|
+
* because the image is in a format that SDL doesn't directly support or
|
204
|
+
* because it's compressed data that could reasonably uncompress to various
|
205
|
+
* formats and SDL_image had to pick one). You can inspect an SDL_Surface for
|
206
|
+
* its specifics, and use SDL_ConvertSurface to then migrate to any supported
|
207
|
+
* format.
|
208
|
+
*
|
209
|
+
* If the image format supports a transparent pixel, SDL will set the colorkey
|
210
|
+
* for the surface. You can enable RLE acceleration on the surface afterwards
|
211
|
+
* by calling: SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
|
212
|
+
*
|
213
|
+
* If `freesrc` is non-zero, the RWops will be closed before returning,
|
214
|
+
* whether this function succeeds or not. SDL_image reads everything it needs
|
215
|
+
* from the RWops during this call in any case.
|
216
|
+
*
|
217
|
+
* Even though this function accepts a file type, SDL_image may still try
|
218
|
+
* other decoders that are capable of detecting file type from the contents of
|
219
|
+
* the image data, but may rely on the caller-provided type string for formats
|
220
|
+
* that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
|
221
|
+
* its ability to guess the format.
|
222
|
+
*
|
223
|
+
* There is a separate function to read files from disk without having to deal
|
224
|
+
* with SDL_RWops: `IMG_Load("filename.jpg")` will call this function and
|
225
|
+
* manage those details for you, determining the file type from the filename's
|
226
|
+
* extension.
|
227
|
+
*
|
228
|
+
* There is also IMG_Load_RW(), which is equivalent to this function except
|
229
|
+
* that it will rely on SDL_image to determine what type of data it is
|
230
|
+
* loading, much like passing a NULL for type.
|
231
|
+
*
|
232
|
+
* If you are using SDL's 2D rendering API, there is an equivalent call to
|
233
|
+
* load images directly into an SDL_Texture for use by the GPU without using a
|
234
|
+
* software surface: call IMG_LoadTextureTyped_RW() instead.
|
235
|
+
*
|
236
|
+
* When done with the returned surface, the app should dispose of it with a
|
237
|
+
* call to SDL_FreeSurface().
|
238
|
+
*
|
239
|
+
* \param src an SDL_RWops that data will be read from.
|
240
|
+
* \param freesrc non-zero to close/free the SDL_RWops before returning, zero
|
241
|
+
* to leave it open.
|
242
|
+
* \param type a filename extension that represent this data ("BMP", "GIF",
|
243
|
+
* "PNG", etc).
|
244
|
+
* \returns a new SDL surface, or NULL on error.
|
245
|
+
*
|
246
|
+
* \since This function is available since SDL_image 2.0.0.
|
247
|
+
*
|
248
|
+
* \sa IMG_Load
|
249
|
+
* \sa IMG_Load_RW
|
250
|
+
* \sa SDL_FreeSurface
|
251
|
+
*/
|
252
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTyped_RW(SDL_RWops *src, int freesrc, const char *type);
|
253
|
+
|
254
|
+
/**
|
255
|
+
* Load an image from a filesystem path into a software surface.
|
256
|
+
*
|
257
|
+
* An SDL_Surface is a buffer of pixels in memory accessible by the CPU. Use
|
258
|
+
* this if you plan to hand the data to something else or manipulate it
|
259
|
+
* further in code.
|
260
|
+
*
|
261
|
+
* There are no guarantees about what format the new SDL_Surface data will be;
|
262
|
+
* in many cases, SDL_image will attempt to supply a surface that exactly
|
263
|
+
* matches the provided image, but in others it might have to convert (either
|
264
|
+
* because the image is in a format that SDL doesn't directly support or
|
265
|
+
* because it's compressed data that could reasonably uncompress to various
|
266
|
+
* formats and SDL_image had to pick one). You can inspect an SDL_Surface for
|
267
|
+
* its specifics, and use SDL_ConvertSurface to then migrate to any supported
|
268
|
+
* format.
|
269
|
+
*
|
270
|
+
* If the image format supports a transparent pixel, SDL will set the colorkey
|
271
|
+
* for the surface. You can enable RLE acceleration on the surface afterwards
|
272
|
+
* by calling: SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
|
273
|
+
*
|
274
|
+
* There is a separate function to read files from an SDL_RWops, if you need
|
275
|
+
* an i/o abstraction to provide data from anywhere instead of a simple
|
276
|
+
* filesystem read; that function is IMG_Load_RW().
|
277
|
+
*
|
278
|
+
* If you are using SDL's 2D rendering API, there is an equivalent call to
|
279
|
+
* load images directly into an SDL_Texture for use by the GPU without using a
|
280
|
+
* software surface: call IMG_LoadTexture() instead.
|
281
|
+
*
|
282
|
+
* When done with the returned surface, the app should dispose of it with a
|
283
|
+
* call to SDL_FreeSurface().
|
284
|
+
*
|
285
|
+
* \param file a path on the filesystem to load an image from.
|
286
|
+
* \returns a new SDL surface, or NULL on error.
|
287
|
+
*
|
288
|
+
* \since This function is available since SDL_image 2.0.0.
|
289
|
+
*
|
290
|
+
* \sa IMG_LoadTyped_RW
|
291
|
+
* \sa IMG_Load_RW
|
292
|
+
* \sa SDL_FreeSurface
|
293
|
+
*/
|
294
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load(const char *file);
|
295
|
+
|
296
|
+
/**
|
297
|
+
* Load an image from an SDL data source into a software surface.
|
298
|
+
*
|
299
|
+
* An SDL_Surface is a buffer of pixels in memory accessible by the CPU. Use
|
300
|
+
* this if you plan to hand the data to something else or manipulate it
|
301
|
+
* further in code.
|
302
|
+
*
|
303
|
+
* There are no guarantees about what format the new SDL_Surface data will be;
|
304
|
+
* in many cases, SDL_image will attempt to supply a surface that exactly
|
305
|
+
* matches the provided image, but in others it might have to convert (either
|
306
|
+
* because the image is in a format that SDL doesn't directly support or
|
307
|
+
* because it's compressed data that could reasonably uncompress to various
|
308
|
+
* formats and SDL_image had to pick one). You can inspect an SDL_Surface for
|
309
|
+
* its specifics, and use SDL_ConvertSurface to then migrate to any supported
|
310
|
+
* format.
|
311
|
+
*
|
312
|
+
* If the image format supports a transparent pixel, SDL will set the colorkey
|
313
|
+
* for the surface. You can enable RLE acceleration on the surface afterwards
|
314
|
+
* by calling: SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);
|
315
|
+
*
|
316
|
+
* If `freesrc` is non-zero, the RWops will be closed before returning,
|
317
|
+
* whether this function succeeds or not. SDL_image reads everything it needs
|
318
|
+
* from the RWops during this call in any case.
|
319
|
+
*
|
320
|
+
* There is a separate function to read files from disk without having to deal
|
321
|
+
* with SDL_RWops: `IMG_Load("filename.jpg")` will call this function and
|
322
|
+
* manage those details for you, determining the file type from the filename's
|
323
|
+
* extension.
|
324
|
+
*
|
325
|
+
* There is also IMG_LoadTyped_RW(), which is equivalent to this function
|
326
|
+
* except a file extension (like "BMP", "JPG", etc) can be specified, in case
|
327
|
+
* SDL_image cannot autodetect the file format.
|
328
|
+
*
|
329
|
+
* If you are using SDL's 2D rendering API, there is an equivalent call to
|
330
|
+
* load images directly into an SDL_Texture for use by the GPU without using a
|
331
|
+
* software surface: call IMG_LoadTexture_RW() instead.
|
332
|
+
*
|
333
|
+
* When done with the returned surface, the app should dispose of it with a
|
334
|
+
* call to SDL_FreeSurface().
|
335
|
+
*
|
336
|
+
* \param src an SDL_RWops that data will be read from.
|
337
|
+
* \param freesrc non-zero to close/free the SDL_RWops before returning, zero
|
338
|
+
* to leave it open.
|
339
|
+
* \returns a new SDL surface, or NULL on error.
|
340
|
+
*
|
341
|
+
* \since This function is available since SDL_image 2.0.0.
|
342
|
+
*
|
343
|
+
* \sa IMG_Load
|
344
|
+
* \sa IMG_LoadTyped_RW
|
345
|
+
* \sa SDL_FreeSurface
|
346
|
+
*/
|
347
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_Load_RW(SDL_RWops *src, int freesrc);
|
348
|
+
|
349
|
+
#if SDL_VERSION_ATLEAST(2,0,0)
|
350
|
+
|
351
|
+
/**
|
352
|
+
* Load an image from a filesystem path into a GPU texture.
|
353
|
+
*
|
354
|
+
* An SDL_Texture represents an image in GPU memory, usable by SDL's 2D Render
|
355
|
+
* API. This can be significantly more efficient than using a CPU-bound
|
356
|
+
* SDL_Surface if you don't need to manipulate the image directly after
|
357
|
+
* loading it.
|
358
|
+
*
|
359
|
+
* If the loaded image has transparency or a colorkey, a texture with an alpha
|
360
|
+
* channel will be created. Otherwise, SDL_image will attempt to create an
|
361
|
+
* SDL_Texture in the most format that most reasonably represents the image
|
362
|
+
* data (but in many cases, this will just end up being 32-bit RGB or 32-bit
|
363
|
+
* RGBA).
|
364
|
+
*
|
365
|
+
* There is a separate function to read files from an SDL_RWops, if you need
|
366
|
+
* an i/o abstraction to provide data from anywhere instead of a simple
|
367
|
+
* filesystem read; that function is IMG_LoadTexture_RW().
|
368
|
+
*
|
369
|
+
* If you would rather decode an image to an SDL_Surface (a buffer of pixels
|
370
|
+
* in CPU memory), call IMG_Load() instead.
|
371
|
+
*
|
372
|
+
* When done with the returned texture, the app should dispose of it with a
|
373
|
+
* call to SDL_DestroyTexture().
|
374
|
+
*
|
375
|
+
* \param renderer the SDL_Renderer to use to create the GPU texture.
|
376
|
+
* \param file a path on the filesystem to load an image from.
|
377
|
+
* \returns a new texture, or NULL on error.
|
378
|
+
*
|
379
|
+
* \since This function is available since SDL_image 2.0.0.
|
380
|
+
*
|
381
|
+
* \sa IMG_LoadTextureTyped_RW
|
382
|
+
* \sa IMG_LoadTexture_RW
|
383
|
+
* \sa SDL_DestroyTexture
|
384
|
+
*/
|
385
|
+
extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture(SDL_Renderer *renderer, const char *file);
|
386
|
+
|
387
|
+
/**
|
388
|
+
* Load an image from an SDL data source into a GPU texture.
|
389
|
+
*
|
390
|
+
* An SDL_Texture represents an image in GPU memory, usable by SDL's 2D Render
|
391
|
+
* API. This can be significantly more efficient than using a CPU-bound
|
392
|
+
* SDL_Surface if you don't need to manipulate the image directly after
|
393
|
+
* loading it.
|
394
|
+
*
|
395
|
+
* If the loaded image has transparency or a colorkey, a texture with an alpha
|
396
|
+
* channel will be created. Otherwise, SDL_image will attempt to create an
|
397
|
+
* SDL_Texture in the most format that most reasonably represents the image
|
398
|
+
* data (but in many cases, this will just end up being 32-bit RGB or 32-bit
|
399
|
+
* RGBA).
|
400
|
+
*
|
401
|
+
* If `freesrc` is non-zero, the RWops will be closed before returning,
|
402
|
+
* whether this function succeeds or not. SDL_image reads everything it needs
|
403
|
+
* from the RWops during this call in any case.
|
404
|
+
*
|
405
|
+
* There is a separate function to read files from disk without having to deal
|
406
|
+
* with SDL_RWops: `IMG_LoadTexture(renderer, "filename.jpg")` will call this
|
407
|
+
* function and manage those details for you, determining the file type from
|
408
|
+
* the filename's extension.
|
409
|
+
*
|
410
|
+
* There is also IMG_LoadTextureTyped_RW(), which is equivalent to this
|
411
|
+
* function except a file extension (like "BMP", "JPG", etc) can be specified,
|
412
|
+
* in case SDL_image cannot autodetect the file format.
|
413
|
+
*
|
414
|
+
* If you would rather decode an image to an SDL_Surface (a buffer of pixels
|
415
|
+
* in CPU memory), call IMG_Load() instead.
|
416
|
+
*
|
417
|
+
* When done with the returned texture, the app should dispose of it with a
|
418
|
+
* call to SDL_DestroyTexture().
|
419
|
+
*
|
420
|
+
* \param renderer the SDL_Renderer to use to create the GPU texture.
|
421
|
+
* \param src an SDL_RWops that data will be read from.
|
422
|
+
* \param freesrc non-zero to close/free the SDL_RWops before returning, zero
|
423
|
+
* to leave it open.
|
424
|
+
* \returns a new texture, or NULL on error.
|
425
|
+
*
|
426
|
+
* \since This function is available since SDL_image 2.0.0.
|
427
|
+
*
|
428
|
+
* \sa IMG_LoadTexture
|
429
|
+
* \sa IMG_LoadTextureTyped_RW
|
430
|
+
* \sa SDL_DestroyTexture
|
431
|
+
*/
|
432
|
+
extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTexture_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc);
|
433
|
+
|
434
|
+
/**
|
435
|
+
* Load an image from an SDL data source into a GPU texture.
|
436
|
+
*
|
437
|
+
* An SDL_Texture represents an image in GPU memory, usable by SDL's 2D Render
|
438
|
+
* API. This can be significantly more efficient than using a CPU-bound
|
439
|
+
* SDL_Surface if you don't need to manipulate the image directly after
|
440
|
+
* loading it.
|
441
|
+
*
|
442
|
+
* If the loaded image has transparency or a colorkey, a texture with an alpha
|
443
|
+
* channel will be created. Otherwise, SDL_image will attempt to create an
|
444
|
+
* SDL_Texture in the most format that most reasonably represents the image
|
445
|
+
* data (but in many cases, this will just end up being 32-bit RGB or 32-bit
|
446
|
+
* RGBA).
|
447
|
+
*
|
448
|
+
* If `freesrc` is non-zero, the RWops will be closed before returning,
|
449
|
+
* whether this function succeeds or not. SDL_image reads everything it needs
|
450
|
+
* from the RWops during this call in any case.
|
451
|
+
*
|
452
|
+
* Even though this function accepts a file type, SDL_image may still try
|
453
|
+
* other decoders that are capable of detecting file type from the contents of
|
454
|
+
* the image data, but may rely on the caller-provided type string for formats
|
455
|
+
* that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
|
456
|
+
* its ability to guess the format.
|
457
|
+
*
|
458
|
+
* There is a separate function to read files from disk without having to deal
|
459
|
+
* with SDL_RWops: `IMG_LoadTexture("filename.jpg")` will call this function
|
460
|
+
* and manage those details for you, determining the file type from the
|
461
|
+
* filename's extension.
|
462
|
+
*
|
463
|
+
* There is also IMG_LoadTexture_RW(), which is equivalent to this function
|
464
|
+
* except that it will rely on SDL_image to determine what type of data it is
|
465
|
+
* loading, much like passing a NULL for type.
|
466
|
+
*
|
467
|
+
* If you would rather decode an image to an SDL_Surface (a buffer of pixels
|
468
|
+
* in CPU memory), call IMG_LoadTyped_RW() instead.
|
469
|
+
*
|
470
|
+
* When done with the returned texture, the app should dispose of it with a
|
471
|
+
* call to SDL_DestroyTexture().
|
472
|
+
*
|
473
|
+
* \param renderer the SDL_Renderer to use to create the GPU texture.
|
474
|
+
* \param src an SDL_RWops that data will be read from.
|
475
|
+
* \param freesrc non-zero to close/free the SDL_RWops before returning, zero
|
476
|
+
* to leave it open.
|
477
|
+
* \param type a filename extension that represent this data ("BMP", "GIF",
|
478
|
+
* "PNG", etc).
|
479
|
+
* \returns a new texture, or NULL on error.
|
480
|
+
*
|
481
|
+
* \since This function is available since SDL_image 2.0.0.
|
482
|
+
*
|
483
|
+
* \sa IMG_LoadTexture
|
484
|
+
* \sa IMG_LoadTexture_RW
|
485
|
+
* \sa SDL_DestroyTexture
|
486
|
+
*/
|
487
|
+
extern DECLSPEC SDL_Texture * SDLCALL IMG_LoadTextureTyped_RW(SDL_Renderer *renderer, SDL_RWops *src, int freesrc, const char *type);
|
488
|
+
#endif /* SDL 2.0 */
|
489
|
+
|
490
|
+
/**
|
491
|
+
* Detect AVIF image data on a readable/seekable SDL_RWops.
|
492
|
+
*
|
493
|
+
* This function attempts to determine if a file is a given filetype, reading
|
494
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
495
|
+
*
|
496
|
+
* There is no distinction made between "not the filetype in question" and
|
497
|
+
* basic i/o errors.
|
498
|
+
*
|
499
|
+
* This function will always attempt to seek the RWops back to where it
|
500
|
+
* started when this function was called, but it will not report any errors in
|
501
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
502
|
+
* this with a different IMG_isTYPE function, or load the image without
|
503
|
+
* further seeking.
|
504
|
+
*
|
505
|
+
* You do not need to call this function to load data; SDL_image can work to
|
506
|
+
* determine file type in many cases in its standard load functions.
|
507
|
+
*
|
508
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
509
|
+
* \returns non-zero if this is AVIF data, zero otherwise.
|
510
|
+
*
|
511
|
+
* \since This function is available since SDL_image 2.6.0.
|
512
|
+
*
|
513
|
+
* \sa IMG_isAVIF
|
514
|
+
* \sa IMG_isICO
|
515
|
+
* \sa IMG_isCUR
|
516
|
+
* \sa IMG_isBMP
|
517
|
+
* \sa IMG_isGIF
|
518
|
+
* \sa IMG_isJPG
|
519
|
+
* \sa IMG_isJXL
|
520
|
+
* \sa IMG_isLBM
|
521
|
+
* \sa IMG_isPCX
|
522
|
+
* \sa IMG_isPNG
|
523
|
+
* \sa IMG_isPNM
|
524
|
+
* \sa IMG_isSVG
|
525
|
+
* \sa IMG_isQOI
|
526
|
+
* \sa IMG_isTIF
|
527
|
+
* \sa IMG_isXCF
|
528
|
+
* \sa IMG_isXPM
|
529
|
+
* \sa IMG_isXV
|
530
|
+
* \sa IMG_isWEBP
|
531
|
+
*/
|
532
|
+
extern DECLSPEC int SDLCALL IMG_isAVIF(SDL_RWops *src);
|
533
|
+
|
534
|
+
/**
|
535
|
+
* Detect ICO image data on a readable/seekable SDL_RWops.
|
536
|
+
*
|
537
|
+
* This function attempts to determine if a file is a given filetype, reading
|
538
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
539
|
+
*
|
540
|
+
* There is no distinction made between "not the filetype in question" and
|
541
|
+
* basic i/o errors.
|
542
|
+
*
|
543
|
+
* This function will always attempt to seek the RWops back to where it
|
544
|
+
* started when this function was called, but it will not report any errors in
|
545
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
546
|
+
* this with a different IMG_isTYPE function, or load the image without
|
547
|
+
* further seeking.
|
548
|
+
*
|
549
|
+
* You do not need to call this function to load data; SDL_image can work to
|
550
|
+
* determine file type in many cases in its standard load functions.
|
551
|
+
*
|
552
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
553
|
+
* \returns non-zero if this is ICO data, zero otherwise.
|
554
|
+
*
|
555
|
+
* \since This function is available since SDL_image 2.0.0.
|
556
|
+
*
|
557
|
+
* \sa IMG_isAVIF
|
558
|
+
* \sa IMG_isCUR
|
559
|
+
* \sa IMG_isBMP
|
560
|
+
* \sa IMG_isGIF
|
561
|
+
* \sa IMG_isJPG
|
562
|
+
* \sa IMG_isJXL
|
563
|
+
* \sa IMG_isLBM
|
564
|
+
* \sa IMG_isPCX
|
565
|
+
* \sa IMG_isPNG
|
566
|
+
* \sa IMG_isPNM
|
567
|
+
* \sa IMG_isSVG
|
568
|
+
* \sa IMG_isQOI
|
569
|
+
* \sa IMG_isTIF
|
570
|
+
* \sa IMG_isXCF
|
571
|
+
* \sa IMG_isXPM
|
572
|
+
* \sa IMG_isXV
|
573
|
+
* \sa IMG_isWEBP
|
574
|
+
*/
|
575
|
+
extern DECLSPEC int SDLCALL IMG_isICO(SDL_RWops *src);
|
576
|
+
|
577
|
+
/**
|
578
|
+
* Detect CUR image data on a readable/seekable SDL_RWops.
|
579
|
+
*
|
580
|
+
* This function attempts to determine if a file is a given filetype, reading
|
581
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
582
|
+
*
|
583
|
+
* There is no distinction made between "not the filetype in question" and
|
584
|
+
* basic i/o errors.
|
585
|
+
*
|
586
|
+
* This function will always attempt to seek the RWops back to where it
|
587
|
+
* started when this function was called, but it will not report any errors in
|
588
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
589
|
+
* this with a different IMG_isTYPE function, or load the image without
|
590
|
+
* further seeking.
|
591
|
+
*
|
592
|
+
* You do not need to call this function to load data; SDL_image can work to
|
593
|
+
* determine file type in many cases in its standard load functions.
|
594
|
+
*
|
595
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
596
|
+
* \returns non-zero if this is CUR data, zero otherwise.
|
597
|
+
*
|
598
|
+
* \since This function is available since SDL_image 2.0.0.
|
599
|
+
*
|
600
|
+
* \sa IMG_isAVIF
|
601
|
+
* \sa IMG_isICO
|
602
|
+
* \sa IMG_isBMP
|
603
|
+
* \sa IMG_isGIF
|
604
|
+
* \sa IMG_isJPG
|
605
|
+
* \sa IMG_isJXL
|
606
|
+
* \sa IMG_isLBM
|
607
|
+
* \sa IMG_isPCX
|
608
|
+
* \sa IMG_isPNG
|
609
|
+
* \sa IMG_isPNM
|
610
|
+
* \sa IMG_isSVG
|
611
|
+
* \sa IMG_isQOI
|
612
|
+
* \sa IMG_isTIF
|
613
|
+
* \sa IMG_isXCF
|
614
|
+
* \sa IMG_isXPM
|
615
|
+
* \sa IMG_isXV
|
616
|
+
* \sa IMG_isWEBP
|
617
|
+
*/
|
618
|
+
extern DECLSPEC int SDLCALL IMG_isCUR(SDL_RWops *src);
|
619
|
+
|
620
|
+
/**
|
621
|
+
* Detect BMP image data on a readable/seekable SDL_RWops.
|
622
|
+
*
|
623
|
+
* This function attempts to determine if a file is a given filetype, reading
|
624
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
625
|
+
*
|
626
|
+
* There is no distinction made between "not the filetype in question" and
|
627
|
+
* basic i/o errors.
|
628
|
+
*
|
629
|
+
* This function will always attempt to seek the RWops back to where it
|
630
|
+
* started when this function was called, but it will not report any errors in
|
631
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
632
|
+
* this with a different IMG_isTYPE function, or load the image without
|
633
|
+
* further seeking.
|
634
|
+
*
|
635
|
+
* You do not need to call this function to load data; SDL_image can work to
|
636
|
+
* determine file type in many cases in its standard load functions.
|
637
|
+
*
|
638
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
639
|
+
* \returns non-zero if this is BMP data, zero otherwise.
|
640
|
+
*
|
641
|
+
* \since This function is available since SDL_image 2.0.0.
|
642
|
+
*
|
643
|
+
* \sa IMG_isAVIF
|
644
|
+
* \sa IMG_isICO
|
645
|
+
* \sa IMG_isCUR
|
646
|
+
* \sa IMG_isGIF
|
647
|
+
* \sa IMG_isJPG
|
648
|
+
* \sa IMG_isJXL
|
649
|
+
* \sa IMG_isLBM
|
650
|
+
* \sa IMG_isPCX
|
651
|
+
* \sa IMG_isPNG
|
652
|
+
* \sa IMG_isPNM
|
653
|
+
* \sa IMG_isSVG
|
654
|
+
* \sa IMG_isQOI
|
655
|
+
* \sa IMG_isTIF
|
656
|
+
* \sa IMG_isXCF
|
657
|
+
* \sa IMG_isXPM
|
658
|
+
* \sa IMG_isXV
|
659
|
+
* \sa IMG_isWEBP
|
660
|
+
*/
|
661
|
+
extern DECLSPEC int SDLCALL IMG_isBMP(SDL_RWops *src);
|
662
|
+
|
663
|
+
/**
|
664
|
+
* Detect GIF image data on a readable/seekable SDL_RWops.
|
665
|
+
*
|
666
|
+
* This function attempts to determine if a file is a given filetype, reading
|
667
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
668
|
+
*
|
669
|
+
* There is no distinction made between "not the filetype in question" and
|
670
|
+
* basic i/o errors.
|
671
|
+
*
|
672
|
+
* This function will always attempt to seek the RWops back to where it
|
673
|
+
* started when this function was called, but it will not report any errors in
|
674
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
675
|
+
* this with a different IMG_isTYPE function, or load the image without
|
676
|
+
* further seeking.
|
677
|
+
*
|
678
|
+
* You do not need to call this function to load data; SDL_image can work to
|
679
|
+
* determine file type in many cases in its standard load functions.
|
680
|
+
*
|
681
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
682
|
+
* \returns non-zero if this is GIF data, zero otherwise.
|
683
|
+
*
|
684
|
+
* \since This function is available since SDL_image 2.0.0.
|
685
|
+
*
|
686
|
+
* \sa IMG_isAVIF
|
687
|
+
* \sa IMG_isICO
|
688
|
+
* \sa IMG_isCUR
|
689
|
+
* \sa IMG_isBMP
|
690
|
+
* \sa IMG_isJPG
|
691
|
+
* \sa IMG_isJXL
|
692
|
+
* \sa IMG_isLBM
|
693
|
+
* \sa IMG_isPCX
|
694
|
+
* \sa IMG_isPNG
|
695
|
+
* \sa IMG_isPNM
|
696
|
+
* \sa IMG_isSVG
|
697
|
+
* \sa IMG_isQOI
|
698
|
+
* \sa IMG_isTIF
|
699
|
+
* \sa IMG_isXCF
|
700
|
+
* \sa IMG_isXPM
|
701
|
+
* \sa IMG_isXV
|
702
|
+
* \sa IMG_isWEBP
|
703
|
+
*/
|
704
|
+
extern DECLSPEC int SDLCALL IMG_isGIF(SDL_RWops *src);
|
705
|
+
|
706
|
+
/**
|
707
|
+
* Detect JPG image data on a readable/seekable SDL_RWops.
|
708
|
+
*
|
709
|
+
* This function attempts to determine if a file is a given filetype, reading
|
710
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
711
|
+
*
|
712
|
+
* There is no distinction made between "not the filetype in question" and
|
713
|
+
* basic i/o errors.
|
714
|
+
*
|
715
|
+
* This function will always attempt to seek the RWops back to where it
|
716
|
+
* started when this function was called, but it will not report any errors in
|
717
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
718
|
+
* this with a different IMG_isTYPE function, or load the image without
|
719
|
+
* further seeking.
|
720
|
+
*
|
721
|
+
* You do not need to call this function to load data; SDL_image can work to
|
722
|
+
* determine file type in many cases in its standard load functions.
|
723
|
+
*
|
724
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
725
|
+
* \returns non-zero if this is JPG data, zero otherwise.
|
726
|
+
*
|
727
|
+
* \since This function is available since SDL_image 2.0.0.
|
728
|
+
*
|
729
|
+
* \sa IMG_isAVIF
|
730
|
+
* \sa IMG_isICO
|
731
|
+
* \sa IMG_isCUR
|
732
|
+
* \sa IMG_isBMP
|
733
|
+
* \sa IMG_isGIF
|
734
|
+
* \sa IMG_isJXL
|
735
|
+
* \sa IMG_isLBM
|
736
|
+
* \sa IMG_isPCX
|
737
|
+
* \sa IMG_isPNG
|
738
|
+
* \sa IMG_isPNM
|
739
|
+
* \sa IMG_isSVG
|
740
|
+
* \sa IMG_isQOI
|
741
|
+
* \sa IMG_isTIF
|
742
|
+
* \sa IMG_isXCF
|
743
|
+
* \sa IMG_isXPM
|
744
|
+
* \sa IMG_isXV
|
745
|
+
* \sa IMG_isWEBP
|
746
|
+
*/
|
747
|
+
extern DECLSPEC int SDLCALL IMG_isJPG(SDL_RWops *src);
|
748
|
+
|
749
|
+
/**
|
750
|
+
* Detect JXL image data on a readable/seekable SDL_RWops.
|
751
|
+
*
|
752
|
+
* This function attempts to determine if a file is a given filetype, reading
|
753
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
754
|
+
*
|
755
|
+
* There is no distinction made between "not the filetype in question" and
|
756
|
+
* basic i/o errors.
|
757
|
+
*
|
758
|
+
* This function will always attempt to seek the RWops back to where it
|
759
|
+
* started when this function was called, but it will not report any errors in
|
760
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
761
|
+
* this with a different IMG_isTYPE function, or load the image without
|
762
|
+
* further seeking.
|
763
|
+
*
|
764
|
+
* You do not need to call this function to load data; SDL_image can work to
|
765
|
+
* determine file type in many cases in its standard load functions.
|
766
|
+
*
|
767
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
768
|
+
* \returns non-zero if this is JXL data, zero otherwise.
|
769
|
+
*
|
770
|
+
* \since This function is available since SDL_image 2.6.0.
|
771
|
+
*
|
772
|
+
* \sa IMG_isAVIF
|
773
|
+
* \sa IMG_isICO
|
774
|
+
* \sa IMG_isCUR
|
775
|
+
* \sa IMG_isBMP
|
776
|
+
* \sa IMG_isGIF
|
777
|
+
* \sa IMG_isJPG
|
778
|
+
* \sa IMG_isLBM
|
779
|
+
* \sa IMG_isPCX
|
780
|
+
* \sa IMG_isPNG
|
781
|
+
* \sa IMG_isPNM
|
782
|
+
* \sa IMG_isSVG
|
783
|
+
* \sa IMG_isQOI
|
784
|
+
* \sa IMG_isTIF
|
785
|
+
* \sa IMG_isXCF
|
786
|
+
* \sa IMG_isXPM
|
787
|
+
* \sa IMG_isXV
|
788
|
+
* \sa IMG_isWEBP
|
789
|
+
*/
|
790
|
+
extern DECLSPEC int SDLCALL IMG_isJXL(SDL_RWops *src);
|
791
|
+
|
792
|
+
/**
|
793
|
+
* Detect LBM image data on a readable/seekable SDL_RWops.
|
794
|
+
*
|
795
|
+
* This function attempts to determine if a file is a given filetype, reading
|
796
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
797
|
+
*
|
798
|
+
* There is no distinction made between "not the filetype in question" and
|
799
|
+
* basic i/o errors.
|
800
|
+
*
|
801
|
+
* This function will always attempt to seek the RWops back to where it
|
802
|
+
* started when this function was called, but it will not report any errors in
|
803
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
804
|
+
* this with a different IMG_isTYPE function, or load the image without
|
805
|
+
* further seeking.
|
806
|
+
*
|
807
|
+
* You do not need to call this function to load data; SDL_image can work to
|
808
|
+
* determine file type in many cases in its standard load functions.
|
809
|
+
*
|
810
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
811
|
+
* \returns non-zero if this is LBM data, zero otherwise.
|
812
|
+
*
|
813
|
+
* \since This function is available since SDL_image 2.0.0.
|
814
|
+
*
|
815
|
+
* \sa IMG_isAVIF
|
816
|
+
* \sa IMG_isICO
|
817
|
+
* \sa IMG_isCUR
|
818
|
+
* \sa IMG_isBMP
|
819
|
+
* \sa IMG_isGIF
|
820
|
+
* \sa IMG_isJPG
|
821
|
+
* \sa IMG_isJXL
|
822
|
+
* \sa IMG_isPCX
|
823
|
+
* \sa IMG_isPNG
|
824
|
+
* \sa IMG_isPNM
|
825
|
+
* \sa IMG_isSVG
|
826
|
+
* \sa IMG_isQOI
|
827
|
+
* \sa IMG_isTIF
|
828
|
+
* \sa IMG_isXCF
|
829
|
+
* \sa IMG_isXPM
|
830
|
+
* \sa IMG_isXV
|
831
|
+
* \sa IMG_isWEBP
|
832
|
+
*/
|
833
|
+
extern DECLSPEC int SDLCALL IMG_isLBM(SDL_RWops *src);
|
834
|
+
|
835
|
+
/**
|
836
|
+
* Detect PCX image data on a readable/seekable SDL_RWops.
|
837
|
+
*
|
838
|
+
* This function attempts to determine if a file is a given filetype, reading
|
839
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
840
|
+
*
|
841
|
+
* There is no distinction made between "not the filetype in question" and
|
842
|
+
* basic i/o errors.
|
843
|
+
*
|
844
|
+
* This function will always attempt to seek the RWops back to where it
|
845
|
+
* started when this function was called, but it will not report any errors in
|
846
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
847
|
+
* this with a different IMG_isTYPE function, or load the image without
|
848
|
+
* further seeking.
|
849
|
+
*
|
850
|
+
* You do not need to call this function to load data; SDL_image can work to
|
851
|
+
* determine file type in many cases in its standard load functions.
|
852
|
+
*
|
853
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
854
|
+
* \returns non-zero if this is PCX data, zero otherwise.
|
855
|
+
*
|
856
|
+
* \since This function is available since SDL_image 2.0.0.
|
857
|
+
*
|
858
|
+
* \sa IMG_isAVIF
|
859
|
+
* \sa IMG_isICO
|
860
|
+
* \sa IMG_isCUR
|
861
|
+
* \sa IMG_isBMP
|
862
|
+
* \sa IMG_isGIF
|
863
|
+
* \sa IMG_isJPG
|
864
|
+
* \sa IMG_isJXL
|
865
|
+
* \sa IMG_isLBM
|
866
|
+
* \sa IMG_isPNG
|
867
|
+
* \sa IMG_isPNM
|
868
|
+
* \sa IMG_isSVG
|
869
|
+
* \sa IMG_isQOI
|
870
|
+
* \sa IMG_isTIF
|
871
|
+
* \sa IMG_isXCF
|
872
|
+
* \sa IMG_isXPM
|
873
|
+
* \sa IMG_isXV
|
874
|
+
* \sa IMG_isWEBP
|
875
|
+
*/
|
876
|
+
extern DECLSPEC int SDLCALL IMG_isPCX(SDL_RWops *src);
|
877
|
+
|
878
|
+
/**
|
879
|
+
* Detect PNG image data on a readable/seekable SDL_RWops.
|
880
|
+
*
|
881
|
+
* This function attempts to determine if a file is a given filetype, reading
|
882
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
883
|
+
*
|
884
|
+
* There is no distinction made between "not the filetype in question" and
|
885
|
+
* basic i/o errors.
|
886
|
+
*
|
887
|
+
* This function will always attempt to seek the RWops back to where it
|
888
|
+
* started when this function was called, but it will not report any errors in
|
889
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
890
|
+
* this with a different IMG_isTYPE function, or load the image without
|
891
|
+
* further seeking.
|
892
|
+
*
|
893
|
+
* You do not need to call this function to load data; SDL_image can work to
|
894
|
+
* determine file type in many cases in its standard load functions.
|
895
|
+
*
|
896
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
897
|
+
* \returns non-zero if this is PNG data, zero otherwise.
|
898
|
+
*
|
899
|
+
* \since This function is available since SDL_image 2.0.0.
|
900
|
+
*
|
901
|
+
* \sa IMG_isAVIF
|
902
|
+
* \sa IMG_isICO
|
903
|
+
* \sa IMG_isCUR
|
904
|
+
* \sa IMG_isBMP
|
905
|
+
* \sa IMG_isGIF
|
906
|
+
* \sa IMG_isJPG
|
907
|
+
* \sa IMG_isJXL
|
908
|
+
* \sa IMG_isLBM
|
909
|
+
* \sa IMG_isPCX
|
910
|
+
* \sa IMG_isPNM
|
911
|
+
* \sa IMG_isSVG
|
912
|
+
* \sa IMG_isQOI
|
913
|
+
* \sa IMG_isTIF
|
914
|
+
* \sa IMG_isXCF
|
915
|
+
* \sa IMG_isXPM
|
916
|
+
* \sa IMG_isXV
|
917
|
+
* \sa IMG_isWEBP
|
918
|
+
*/
|
919
|
+
extern DECLSPEC int SDLCALL IMG_isPNG(SDL_RWops *src);
|
920
|
+
|
921
|
+
/**
|
922
|
+
* Detect PNM image data on a readable/seekable SDL_RWops.
|
923
|
+
*
|
924
|
+
* This function attempts to determine if a file is a given filetype, reading
|
925
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
926
|
+
*
|
927
|
+
* There is no distinction made between "not the filetype in question" and
|
928
|
+
* basic i/o errors.
|
929
|
+
*
|
930
|
+
* This function will always attempt to seek the RWops back to where it
|
931
|
+
* started when this function was called, but it will not report any errors in
|
932
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
933
|
+
* this with a different IMG_isTYPE function, or load the image without
|
934
|
+
* further seeking.
|
935
|
+
*
|
936
|
+
* You do not need to call this function to load data; SDL_image can work to
|
937
|
+
* determine file type in many cases in its standard load functions.
|
938
|
+
*
|
939
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
940
|
+
* \returns non-zero if this is PNM data, zero otherwise.
|
941
|
+
*
|
942
|
+
* \since This function is available since SDL_image 2.0.0.
|
943
|
+
*
|
944
|
+
* \sa IMG_isAVIF
|
945
|
+
* \sa IMG_isICO
|
946
|
+
* \sa IMG_isCUR
|
947
|
+
* \sa IMG_isBMP
|
948
|
+
* \sa IMG_isGIF
|
949
|
+
* \sa IMG_isJPG
|
950
|
+
* \sa IMG_isJXL
|
951
|
+
* \sa IMG_isLBM
|
952
|
+
* \sa IMG_isPCX
|
953
|
+
* \sa IMG_isPNG
|
954
|
+
* \sa IMG_isSVG
|
955
|
+
* \sa IMG_isQOI
|
956
|
+
* \sa IMG_isTIF
|
957
|
+
* \sa IMG_isXCF
|
958
|
+
* \sa IMG_isXPM
|
959
|
+
* \sa IMG_isXV
|
960
|
+
* \sa IMG_isWEBP
|
961
|
+
*/
|
962
|
+
extern DECLSPEC int SDLCALL IMG_isPNM(SDL_RWops *src);
|
963
|
+
|
964
|
+
/**
|
965
|
+
* Detect SVG image data on a readable/seekable SDL_RWops.
|
966
|
+
*
|
967
|
+
* This function attempts to determine if a file is a given filetype, reading
|
968
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
969
|
+
*
|
970
|
+
* There is no distinction made between "not the filetype in question" and
|
971
|
+
* basic i/o errors.
|
972
|
+
*
|
973
|
+
* This function will always attempt to seek the RWops back to where it
|
974
|
+
* started when this function was called, but it will not report any errors in
|
975
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
976
|
+
* this with a different IMG_isTYPE function, or load the image without
|
977
|
+
* further seeking.
|
978
|
+
*
|
979
|
+
* You do not need to call this function to load data; SDL_image can work to
|
980
|
+
* determine file type in many cases in its standard load functions.
|
981
|
+
*
|
982
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
983
|
+
* \returns non-zero if this is SVG data, zero otherwise.
|
984
|
+
*
|
985
|
+
* \since This function is available since SDL_image 2.0.2.
|
986
|
+
*
|
987
|
+
* \sa IMG_isAVIF
|
988
|
+
* \sa IMG_isICO
|
989
|
+
* \sa IMG_isCUR
|
990
|
+
* \sa IMG_isBMP
|
991
|
+
* \sa IMG_isGIF
|
992
|
+
* \sa IMG_isJPG
|
993
|
+
* \sa IMG_isJXL
|
994
|
+
* \sa IMG_isLBM
|
995
|
+
* \sa IMG_isPCX
|
996
|
+
* \sa IMG_isPNG
|
997
|
+
* \sa IMG_isPNM
|
998
|
+
* \sa IMG_isQOI
|
999
|
+
* \sa IMG_isTIF
|
1000
|
+
* \sa IMG_isXCF
|
1001
|
+
* \sa IMG_isXPM
|
1002
|
+
* \sa IMG_isXV
|
1003
|
+
* \sa IMG_isWEBP
|
1004
|
+
*/
|
1005
|
+
extern DECLSPEC int SDLCALL IMG_isSVG(SDL_RWops *src);
|
1006
|
+
|
1007
|
+
/**
|
1008
|
+
* Detect QOI image data on a readable/seekable SDL_RWops.
|
1009
|
+
*
|
1010
|
+
* This function attempts to determine if a file is a given filetype, reading
|
1011
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
1012
|
+
*
|
1013
|
+
* There is no distinction made between "not the filetype in question" and
|
1014
|
+
* basic i/o errors.
|
1015
|
+
*
|
1016
|
+
* This function will always attempt to seek the RWops back to where it
|
1017
|
+
* started when this function was called, but it will not report any errors in
|
1018
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
1019
|
+
* this with a different IMG_isTYPE function, or load the image without
|
1020
|
+
* further seeking.
|
1021
|
+
*
|
1022
|
+
* You do not need to call this function to load data; SDL_image can work to
|
1023
|
+
* determine file type in many cases in its standard load functions.
|
1024
|
+
*
|
1025
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
1026
|
+
* \returns non-zero if this is QOI data, zero otherwise.
|
1027
|
+
*
|
1028
|
+
* \since This function is available since SDL_image 2.6.0.
|
1029
|
+
*
|
1030
|
+
* \sa IMG_isAVIF
|
1031
|
+
* \sa IMG_isICO
|
1032
|
+
* \sa IMG_isCUR
|
1033
|
+
* \sa IMG_isBMP
|
1034
|
+
* \sa IMG_isGIF
|
1035
|
+
* \sa IMG_isJPG
|
1036
|
+
* \sa IMG_isJXL
|
1037
|
+
* \sa IMG_isLBM
|
1038
|
+
* \sa IMG_isPCX
|
1039
|
+
* \sa IMG_isPNG
|
1040
|
+
* \sa IMG_isPNM
|
1041
|
+
* \sa IMG_isSVG
|
1042
|
+
* \sa IMG_isTIF
|
1043
|
+
* \sa IMG_isXCF
|
1044
|
+
* \sa IMG_isXPM
|
1045
|
+
* \sa IMG_isXV
|
1046
|
+
* \sa IMG_isWEBP
|
1047
|
+
*/
|
1048
|
+
extern DECLSPEC int SDLCALL IMG_isQOI(SDL_RWops *src);
|
1049
|
+
|
1050
|
+
/**
|
1051
|
+
* Detect TIFF image data on a readable/seekable SDL_RWops.
|
1052
|
+
*
|
1053
|
+
* This function attempts to determine if a file is a given filetype, reading
|
1054
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
1055
|
+
*
|
1056
|
+
* There is no distinction made between "not the filetype in question" and
|
1057
|
+
* basic i/o errors.
|
1058
|
+
*
|
1059
|
+
* This function will always attempt to seek the RWops back to where it
|
1060
|
+
* started when this function was called, but it will not report any errors in
|
1061
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
1062
|
+
* this with a different IMG_isTYPE function, or load the image without
|
1063
|
+
* further seeking.
|
1064
|
+
*
|
1065
|
+
* You do not need to call this function to load data; SDL_image can work to
|
1066
|
+
* determine file type in many cases in its standard load functions.
|
1067
|
+
*
|
1068
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
1069
|
+
* \returns non-zero if this is TIFF data, zero otherwise.
|
1070
|
+
*
|
1071
|
+
* \since This function is available since SDL_image 2.0.0.
|
1072
|
+
*
|
1073
|
+
* \sa IMG_isAVIF
|
1074
|
+
* \sa IMG_isICO
|
1075
|
+
* \sa IMG_isCUR
|
1076
|
+
* \sa IMG_isBMP
|
1077
|
+
* \sa IMG_isGIF
|
1078
|
+
* \sa IMG_isJPG
|
1079
|
+
* \sa IMG_isJXL
|
1080
|
+
* \sa IMG_isLBM
|
1081
|
+
* \sa IMG_isPCX
|
1082
|
+
* \sa IMG_isPNG
|
1083
|
+
* \sa IMG_isPNM
|
1084
|
+
* \sa IMG_isSVG
|
1085
|
+
* \sa IMG_isQOI
|
1086
|
+
* \sa IMG_isXCF
|
1087
|
+
* \sa IMG_isXPM
|
1088
|
+
* \sa IMG_isXV
|
1089
|
+
* \sa IMG_isWEBP
|
1090
|
+
*/
|
1091
|
+
extern DECLSPEC int SDLCALL IMG_isTIF(SDL_RWops *src);
|
1092
|
+
|
1093
|
+
/**
|
1094
|
+
* Detect XCF image data on a readable/seekable SDL_RWops.
|
1095
|
+
*
|
1096
|
+
* This function attempts to determine if a file is a given filetype, reading
|
1097
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
1098
|
+
*
|
1099
|
+
* There is no distinction made between "not the filetype in question" and
|
1100
|
+
* basic i/o errors.
|
1101
|
+
*
|
1102
|
+
* This function will always attempt to seek the RWops back to where it
|
1103
|
+
* started when this function was called, but it will not report any errors in
|
1104
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
1105
|
+
* this with a different IMG_isTYPE function, or load the image without
|
1106
|
+
* further seeking.
|
1107
|
+
*
|
1108
|
+
* You do not need to call this function to load data; SDL_image can work to
|
1109
|
+
* determine file type in many cases in its standard load functions.
|
1110
|
+
*
|
1111
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
1112
|
+
* \returns non-zero if this is XCF data, zero otherwise.
|
1113
|
+
*
|
1114
|
+
* \since This function is available since SDL_image 2.0.0.
|
1115
|
+
*
|
1116
|
+
* \sa IMG_isAVIF
|
1117
|
+
* \sa IMG_isICO
|
1118
|
+
* \sa IMG_isCUR
|
1119
|
+
* \sa IMG_isBMP
|
1120
|
+
* \sa IMG_isGIF
|
1121
|
+
* \sa IMG_isJPG
|
1122
|
+
* \sa IMG_isJXL
|
1123
|
+
* \sa IMG_isLBM
|
1124
|
+
* \sa IMG_isPCX
|
1125
|
+
* \sa IMG_isPNG
|
1126
|
+
* \sa IMG_isPNM
|
1127
|
+
* \sa IMG_isSVG
|
1128
|
+
* \sa IMG_isQOI
|
1129
|
+
* \sa IMG_isTIF
|
1130
|
+
* \sa IMG_isXPM
|
1131
|
+
* \sa IMG_isXV
|
1132
|
+
* \sa IMG_isWEBP
|
1133
|
+
*/
|
1134
|
+
extern DECLSPEC int SDLCALL IMG_isXCF(SDL_RWops *src);
|
1135
|
+
|
1136
|
+
/**
|
1137
|
+
* Detect XPM image data on a readable/seekable SDL_RWops.
|
1138
|
+
*
|
1139
|
+
* This function attempts to determine if a file is a given filetype, reading
|
1140
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
1141
|
+
*
|
1142
|
+
* There is no distinction made between "not the filetype in question" and
|
1143
|
+
* basic i/o errors.
|
1144
|
+
*
|
1145
|
+
* This function will always attempt to seek the RWops back to where it
|
1146
|
+
* started when this function was called, but it will not report any errors in
|
1147
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
1148
|
+
* this with a different IMG_isTYPE function, or load the image without
|
1149
|
+
* further seeking.
|
1150
|
+
*
|
1151
|
+
* You do not need to call this function to load data; SDL_image can work to
|
1152
|
+
* determine file type in many cases in its standard load functions.
|
1153
|
+
*
|
1154
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
1155
|
+
* \returns non-zero if this is XPM data, zero otherwise.
|
1156
|
+
*
|
1157
|
+
* \since This function is available since SDL_image 2.0.0.
|
1158
|
+
*
|
1159
|
+
* \sa IMG_isAVIF
|
1160
|
+
* \sa IMG_isICO
|
1161
|
+
* \sa IMG_isCUR
|
1162
|
+
* \sa IMG_isBMP
|
1163
|
+
* \sa IMG_isGIF
|
1164
|
+
* \sa IMG_isJPG
|
1165
|
+
* \sa IMG_isJXL
|
1166
|
+
* \sa IMG_isLBM
|
1167
|
+
* \sa IMG_isPCX
|
1168
|
+
* \sa IMG_isPNG
|
1169
|
+
* \sa IMG_isPNM
|
1170
|
+
* \sa IMG_isSVG
|
1171
|
+
* \sa IMG_isQOI
|
1172
|
+
* \sa IMG_isTIF
|
1173
|
+
* \sa IMG_isXCF
|
1174
|
+
* \sa IMG_isXV
|
1175
|
+
* \sa IMG_isWEBP
|
1176
|
+
*/
|
1177
|
+
extern DECLSPEC int SDLCALL IMG_isXPM(SDL_RWops *src);
|
1178
|
+
|
1179
|
+
/**
|
1180
|
+
* Detect XV image data on a readable/seekable SDL_RWops.
|
1181
|
+
*
|
1182
|
+
* This function attempts to determine if a file is a given filetype, reading
|
1183
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
1184
|
+
*
|
1185
|
+
* There is no distinction made between "not the filetype in question" and
|
1186
|
+
* basic i/o errors.
|
1187
|
+
*
|
1188
|
+
* This function will always attempt to seek the RWops back to where it
|
1189
|
+
* started when this function was called, but it will not report any errors in
|
1190
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
1191
|
+
* this with a different IMG_isTYPE function, or load the image without
|
1192
|
+
* further seeking.
|
1193
|
+
*
|
1194
|
+
* You do not need to call this function to load data; SDL_image can work to
|
1195
|
+
* determine file type in many cases in its standard load functions.
|
1196
|
+
*
|
1197
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
1198
|
+
* \returns non-zero if this is XV data, zero otherwise.
|
1199
|
+
*
|
1200
|
+
* \since This function is available since SDL_image 2.0.0.
|
1201
|
+
*
|
1202
|
+
* \sa IMG_isAVIF
|
1203
|
+
* \sa IMG_isICO
|
1204
|
+
* \sa IMG_isCUR
|
1205
|
+
* \sa IMG_isBMP
|
1206
|
+
* \sa IMG_isGIF
|
1207
|
+
* \sa IMG_isJPG
|
1208
|
+
* \sa IMG_isJXL
|
1209
|
+
* \sa IMG_isLBM
|
1210
|
+
* \sa IMG_isPCX
|
1211
|
+
* \sa IMG_isPNG
|
1212
|
+
* \sa IMG_isPNM
|
1213
|
+
* \sa IMG_isSVG
|
1214
|
+
* \sa IMG_isQOI
|
1215
|
+
* \sa IMG_isTIF
|
1216
|
+
* \sa IMG_isXCF
|
1217
|
+
* \sa IMG_isXPM
|
1218
|
+
* \sa IMG_isWEBP
|
1219
|
+
*/
|
1220
|
+
extern DECLSPEC int SDLCALL IMG_isXV(SDL_RWops *src);
|
1221
|
+
|
1222
|
+
/**
|
1223
|
+
* Detect WEBP image data on a readable/seekable SDL_RWops.
|
1224
|
+
*
|
1225
|
+
* This function attempts to determine if a file is a given filetype, reading
|
1226
|
+
* the least amount possible from the SDL_RWops (usually a few bytes).
|
1227
|
+
*
|
1228
|
+
* There is no distinction made between "not the filetype in question" and
|
1229
|
+
* basic i/o errors.
|
1230
|
+
*
|
1231
|
+
* This function will always attempt to seek the RWops back to where it
|
1232
|
+
* started when this function was called, but it will not report any errors in
|
1233
|
+
* doing so, but assuming seeking works, this means you can immediately use
|
1234
|
+
* this with a different IMG_isTYPE function, or load the image without
|
1235
|
+
* further seeking.
|
1236
|
+
*
|
1237
|
+
* You do not need to call this function to load data; SDL_image can work to
|
1238
|
+
* determine file type in many cases in its standard load functions.
|
1239
|
+
*
|
1240
|
+
* \param src a seekable/readable SDL_RWops to provide image data.
|
1241
|
+
* \returns non-zero if this is WEBP data, zero otherwise.
|
1242
|
+
*
|
1243
|
+
* \since This function is available since SDL_image 2.0.0.
|
1244
|
+
*
|
1245
|
+
* \sa IMG_isAVIF
|
1246
|
+
* \sa IMG_isICO
|
1247
|
+
* \sa IMG_isCUR
|
1248
|
+
* \sa IMG_isBMP
|
1249
|
+
* \sa IMG_isGIF
|
1250
|
+
* \sa IMG_isJPG
|
1251
|
+
* \sa IMG_isJXL
|
1252
|
+
* \sa IMG_isLBM
|
1253
|
+
* \sa IMG_isPCX
|
1254
|
+
* \sa IMG_isPNG
|
1255
|
+
* \sa IMG_isPNM
|
1256
|
+
* \sa IMG_isSVG
|
1257
|
+
* \sa IMG_isQOI
|
1258
|
+
* \sa IMG_isTIF
|
1259
|
+
* \sa IMG_isXCF
|
1260
|
+
* \sa IMG_isXPM
|
1261
|
+
* \sa IMG_isXV
|
1262
|
+
*/
|
1263
|
+
extern DECLSPEC int SDLCALL IMG_isWEBP(SDL_RWops *src);
|
1264
|
+
|
1265
|
+
/**
|
1266
|
+
* Load a AVIF image directly.
|
1267
|
+
*
|
1268
|
+
* If you know you definitely have a AVIF image, you can call this function,
|
1269
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1270
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1271
|
+
* interface available here.
|
1272
|
+
*
|
1273
|
+
* \param src an SDL_RWops to load image data from.
|
1274
|
+
* \returns SDL surface, or NULL on error
|
1275
|
+
*
|
1276
|
+
* \since This function is available since SDL_image 2.6.0.
|
1277
|
+
*
|
1278
|
+
* \sa IMG_LoadICO_RW
|
1279
|
+
* \sa IMG_LoadCUR_RW
|
1280
|
+
* \sa IMG_LoadBMP_RW
|
1281
|
+
* \sa IMG_LoadGIF_RW
|
1282
|
+
* \sa IMG_LoadJPG_RW
|
1283
|
+
* \sa IMG_LoadJXL_RW
|
1284
|
+
* \sa IMG_LoadLBM_RW
|
1285
|
+
* \sa IMG_LoadPCX_RW
|
1286
|
+
* \sa IMG_LoadPNG_RW
|
1287
|
+
* \sa IMG_LoadPNM_RW
|
1288
|
+
* \sa IMG_LoadSVG_RW
|
1289
|
+
* \sa IMG_LoadQOI_RW
|
1290
|
+
* \sa IMG_LoadTGA_RW
|
1291
|
+
* \sa IMG_LoadTIF_RW
|
1292
|
+
* \sa IMG_LoadXCF_RW
|
1293
|
+
* \sa IMG_LoadXPM_RW
|
1294
|
+
* \sa IMG_LoadXV_RW
|
1295
|
+
* \sa IMG_LoadWEBP_RW
|
1296
|
+
*/
|
1297
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadAVIF_RW(SDL_RWops *src);
|
1298
|
+
|
1299
|
+
/**
|
1300
|
+
* Load a ICO image directly.
|
1301
|
+
*
|
1302
|
+
* If you know you definitely have a ICO image, you can call this function,
|
1303
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1304
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1305
|
+
* interface available here.
|
1306
|
+
*
|
1307
|
+
* \param src an SDL_RWops to load image data from.
|
1308
|
+
* \returns SDL surface, or NULL on error
|
1309
|
+
*
|
1310
|
+
* \since This function is available since SDL_image 2.0.0.
|
1311
|
+
*
|
1312
|
+
* \sa IMG_LoadAVIF_RW
|
1313
|
+
* \sa IMG_LoadCUR_RW
|
1314
|
+
* \sa IMG_LoadBMP_RW
|
1315
|
+
* \sa IMG_LoadGIF_RW
|
1316
|
+
* \sa IMG_LoadJPG_RW
|
1317
|
+
* \sa IMG_LoadJXL_RW
|
1318
|
+
* \sa IMG_LoadLBM_RW
|
1319
|
+
* \sa IMG_LoadPCX_RW
|
1320
|
+
* \sa IMG_LoadPNG_RW
|
1321
|
+
* \sa IMG_LoadPNM_RW
|
1322
|
+
* \sa IMG_LoadSVG_RW
|
1323
|
+
* \sa IMG_LoadQOI_RW
|
1324
|
+
* \sa IMG_LoadTGA_RW
|
1325
|
+
* \sa IMG_LoadTIF_RW
|
1326
|
+
* \sa IMG_LoadXCF_RW
|
1327
|
+
* \sa IMG_LoadXPM_RW
|
1328
|
+
* \sa IMG_LoadXV_RW
|
1329
|
+
* \sa IMG_LoadWEBP_RW
|
1330
|
+
*/
|
1331
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadICO_RW(SDL_RWops *src);
|
1332
|
+
|
1333
|
+
/**
|
1334
|
+
* Load a CUR image directly.
|
1335
|
+
*
|
1336
|
+
* If you know you definitely have a CUR image, you can call this function,
|
1337
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1338
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1339
|
+
* interface available here.
|
1340
|
+
*
|
1341
|
+
* \param src an SDL_RWops to load image data from.
|
1342
|
+
* \returns SDL surface, or NULL on error
|
1343
|
+
*
|
1344
|
+
* \since This function is available since SDL_image 2.0.0.
|
1345
|
+
*
|
1346
|
+
* \sa IMG_LoadAVIF_RW
|
1347
|
+
* \sa IMG_LoadICO_RW
|
1348
|
+
* \sa IMG_LoadBMP_RW
|
1349
|
+
* \sa IMG_LoadGIF_RW
|
1350
|
+
* \sa IMG_LoadJPG_RW
|
1351
|
+
* \sa IMG_LoadJXL_RW
|
1352
|
+
* \sa IMG_LoadLBM_RW
|
1353
|
+
* \sa IMG_LoadPCX_RW
|
1354
|
+
* \sa IMG_LoadPNG_RW
|
1355
|
+
* \sa IMG_LoadPNM_RW
|
1356
|
+
* \sa IMG_LoadSVG_RW
|
1357
|
+
* \sa IMG_LoadQOI_RW
|
1358
|
+
* \sa IMG_LoadTGA_RW
|
1359
|
+
* \sa IMG_LoadTIF_RW
|
1360
|
+
* \sa IMG_LoadXCF_RW
|
1361
|
+
* \sa IMG_LoadXPM_RW
|
1362
|
+
* \sa IMG_LoadXV_RW
|
1363
|
+
* \sa IMG_LoadWEBP_RW
|
1364
|
+
*/
|
1365
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadCUR_RW(SDL_RWops *src);
|
1366
|
+
|
1367
|
+
/**
|
1368
|
+
* Load a BMP image directly.
|
1369
|
+
*
|
1370
|
+
* If you know you definitely have a BMP image, you can call this function,
|
1371
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1372
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1373
|
+
* interface available here.
|
1374
|
+
*
|
1375
|
+
* \param src an SDL_RWops to load image data from.
|
1376
|
+
* \returns SDL surface, or NULL on error
|
1377
|
+
*
|
1378
|
+
* \since This function is available since SDL_image 2.0.0.
|
1379
|
+
*
|
1380
|
+
* \sa IMG_LoadAVIF_RW
|
1381
|
+
* \sa IMG_LoadICO_RW
|
1382
|
+
* \sa IMG_LoadCUR_RW
|
1383
|
+
* \sa IMG_LoadGIF_RW
|
1384
|
+
* \sa IMG_LoadJPG_RW
|
1385
|
+
* \sa IMG_LoadJXL_RW
|
1386
|
+
* \sa IMG_LoadLBM_RW
|
1387
|
+
* \sa IMG_LoadPCX_RW
|
1388
|
+
* \sa IMG_LoadPNG_RW
|
1389
|
+
* \sa IMG_LoadPNM_RW
|
1390
|
+
* \sa IMG_LoadSVG_RW
|
1391
|
+
* \sa IMG_LoadQOI_RW
|
1392
|
+
* \sa IMG_LoadTGA_RW
|
1393
|
+
* \sa IMG_LoadTIF_RW
|
1394
|
+
* \sa IMG_LoadXCF_RW
|
1395
|
+
* \sa IMG_LoadXPM_RW
|
1396
|
+
* \sa IMG_LoadXV_RW
|
1397
|
+
* \sa IMG_LoadWEBP_RW
|
1398
|
+
*/
|
1399
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadBMP_RW(SDL_RWops *src);
|
1400
|
+
|
1401
|
+
/**
|
1402
|
+
* Load a GIF image directly.
|
1403
|
+
*
|
1404
|
+
* If you know you definitely have a GIF image, you can call this function,
|
1405
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1406
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1407
|
+
* interface available here.
|
1408
|
+
*
|
1409
|
+
* \param src an SDL_RWops to load image data from.
|
1410
|
+
* \returns SDL surface, or NULL on error
|
1411
|
+
*
|
1412
|
+
* \since This function is available since SDL_image 2.0.0.
|
1413
|
+
*
|
1414
|
+
* \sa IMG_LoadAVIF_RW
|
1415
|
+
* \sa IMG_LoadICO_RW
|
1416
|
+
* \sa IMG_LoadCUR_RW
|
1417
|
+
* \sa IMG_LoadBMP_RW
|
1418
|
+
* \sa IMG_LoadJPG_RW
|
1419
|
+
* \sa IMG_LoadJXL_RW
|
1420
|
+
* \sa IMG_LoadLBM_RW
|
1421
|
+
* \sa IMG_LoadPCX_RW
|
1422
|
+
* \sa IMG_LoadPNG_RW
|
1423
|
+
* \sa IMG_LoadPNM_RW
|
1424
|
+
* \sa IMG_LoadSVG_RW
|
1425
|
+
* \sa IMG_LoadQOI_RW
|
1426
|
+
* \sa IMG_LoadTGA_RW
|
1427
|
+
* \sa IMG_LoadTIF_RW
|
1428
|
+
* \sa IMG_LoadXCF_RW
|
1429
|
+
* \sa IMG_LoadXPM_RW
|
1430
|
+
* \sa IMG_LoadXV_RW
|
1431
|
+
* \sa IMG_LoadWEBP_RW
|
1432
|
+
*/
|
1433
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadGIF_RW(SDL_RWops *src);
|
1434
|
+
|
1435
|
+
/**
|
1436
|
+
* Load a JPG image directly.
|
1437
|
+
*
|
1438
|
+
* If you know you definitely have a JPG image, you can call this function,
|
1439
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1440
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1441
|
+
* interface available here.
|
1442
|
+
*
|
1443
|
+
* \param src an SDL_RWops to load image data from.
|
1444
|
+
* \returns SDL surface, or NULL on error
|
1445
|
+
*
|
1446
|
+
* \since This function is available since SDL_image 2.0.0.
|
1447
|
+
*
|
1448
|
+
* \sa IMG_LoadAVIF_RW
|
1449
|
+
* \sa IMG_LoadICO_RW
|
1450
|
+
* \sa IMG_LoadCUR_RW
|
1451
|
+
* \sa IMG_LoadBMP_RW
|
1452
|
+
* \sa IMG_LoadGIF_RW
|
1453
|
+
* \sa IMG_LoadJXL_RW
|
1454
|
+
* \sa IMG_LoadLBM_RW
|
1455
|
+
* \sa IMG_LoadPCX_RW
|
1456
|
+
* \sa IMG_LoadPNG_RW
|
1457
|
+
* \sa IMG_LoadPNM_RW
|
1458
|
+
* \sa IMG_LoadSVG_RW
|
1459
|
+
* \sa IMG_LoadQOI_RW
|
1460
|
+
* \sa IMG_LoadTGA_RW
|
1461
|
+
* \sa IMG_LoadTIF_RW
|
1462
|
+
* \sa IMG_LoadXCF_RW
|
1463
|
+
* \sa IMG_LoadXPM_RW
|
1464
|
+
* \sa IMG_LoadXV_RW
|
1465
|
+
* \sa IMG_LoadWEBP_RW
|
1466
|
+
*/
|
1467
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJPG_RW(SDL_RWops *src);
|
1468
|
+
|
1469
|
+
/**
|
1470
|
+
* Load a JXL image directly.
|
1471
|
+
*
|
1472
|
+
* If you know you definitely have a JXL image, you can call this function,
|
1473
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1474
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1475
|
+
* interface available here.
|
1476
|
+
*
|
1477
|
+
* \param src an SDL_RWops to load image data from.
|
1478
|
+
* \returns SDL surface, or NULL on error
|
1479
|
+
*
|
1480
|
+
* \since This function is available since SDL_image 2.6.0.
|
1481
|
+
*
|
1482
|
+
* \sa IMG_LoadAVIF_RW
|
1483
|
+
* \sa IMG_LoadICO_RW
|
1484
|
+
* \sa IMG_LoadCUR_RW
|
1485
|
+
* \sa IMG_LoadBMP_RW
|
1486
|
+
* \sa IMG_LoadGIF_RW
|
1487
|
+
* \sa IMG_LoadJPG_RW
|
1488
|
+
* \sa IMG_LoadLBM_RW
|
1489
|
+
* \sa IMG_LoadPCX_RW
|
1490
|
+
* \sa IMG_LoadPNG_RW
|
1491
|
+
* \sa IMG_LoadPNM_RW
|
1492
|
+
* \sa IMG_LoadSVG_RW
|
1493
|
+
* \sa IMG_LoadQOI_RW
|
1494
|
+
* \sa IMG_LoadTGA_RW
|
1495
|
+
* \sa IMG_LoadTIF_RW
|
1496
|
+
* \sa IMG_LoadXCF_RW
|
1497
|
+
* \sa IMG_LoadXPM_RW
|
1498
|
+
* \sa IMG_LoadXV_RW
|
1499
|
+
* \sa IMG_LoadWEBP_RW
|
1500
|
+
*/
|
1501
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadJXL_RW(SDL_RWops *src);
|
1502
|
+
|
1503
|
+
/**
|
1504
|
+
* Load a LBM image directly.
|
1505
|
+
*
|
1506
|
+
* If you know you definitely have a LBM image, you can call this function,
|
1507
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1508
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1509
|
+
* interface available here.
|
1510
|
+
*
|
1511
|
+
* \param src an SDL_RWops to load image data from.
|
1512
|
+
* \returns SDL surface, or NULL on error
|
1513
|
+
*
|
1514
|
+
* \since This function is available since SDL_image 2.0.0.
|
1515
|
+
*
|
1516
|
+
* \sa IMG_LoadAVIF_RW
|
1517
|
+
* \sa IMG_LoadICO_RW
|
1518
|
+
* \sa IMG_LoadCUR_RW
|
1519
|
+
* \sa IMG_LoadBMP_RW
|
1520
|
+
* \sa IMG_LoadGIF_RW
|
1521
|
+
* \sa IMG_LoadJPG_RW
|
1522
|
+
* \sa IMG_LoadJXL_RW
|
1523
|
+
* \sa IMG_LoadPCX_RW
|
1524
|
+
* \sa IMG_LoadPNG_RW
|
1525
|
+
* \sa IMG_LoadPNM_RW
|
1526
|
+
* \sa IMG_LoadSVG_RW
|
1527
|
+
* \sa IMG_LoadQOI_RW
|
1528
|
+
* \sa IMG_LoadTGA_RW
|
1529
|
+
* \sa IMG_LoadTIF_RW
|
1530
|
+
* \sa IMG_LoadXCF_RW
|
1531
|
+
* \sa IMG_LoadXPM_RW
|
1532
|
+
* \sa IMG_LoadXV_RW
|
1533
|
+
* \sa IMG_LoadWEBP_RW
|
1534
|
+
*/
|
1535
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadLBM_RW(SDL_RWops *src);
|
1536
|
+
|
1537
|
+
/**
|
1538
|
+
* Load a PCX image directly.
|
1539
|
+
*
|
1540
|
+
* If you know you definitely have a PCX image, you can call this function,
|
1541
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1542
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1543
|
+
* interface available here.
|
1544
|
+
*
|
1545
|
+
* \param src an SDL_RWops to load image data from.
|
1546
|
+
* \returns SDL surface, or NULL on error
|
1547
|
+
*
|
1548
|
+
* \since This function is available since SDL_image 2.0.0.
|
1549
|
+
*
|
1550
|
+
* \sa IMG_LoadAVIF_RW
|
1551
|
+
* \sa IMG_LoadICO_RW
|
1552
|
+
* \sa IMG_LoadCUR_RW
|
1553
|
+
* \sa IMG_LoadBMP_RW
|
1554
|
+
* \sa IMG_LoadGIF_RW
|
1555
|
+
* \sa IMG_LoadJPG_RW
|
1556
|
+
* \sa IMG_LoadJXL_RW
|
1557
|
+
* \sa IMG_LoadLBM_RW
|
1558
|
+
* \sa IMG_LoadPNG_RW
|
1559
|
+
* \sa IMG_LoadPNM_RW
|
1560
|
+
* \sa IMG_LoadSVG_RW
|
1561
|
+
* \sa IMG_LoadQOI_RW
|
1562
|
+
* \sa IMG_LoadTGA_RW
|
1563
|
+
* \sa IMG_LoadTIF_RW
|
1564
|
+
* \sa IMG_LoadXCF_RW
|
1565
|
+
* \sa IMG_LoadXPM_RW
|
1566
|
+
* \sa IMG_LoadXV_RW
|
1567
|
+
* \sa IMG_LoadWEBP_RW
|
1568
|
+
*/
|
1569
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPCX_RW(SDL_RWops *src);
|
1570
|
+
|
1571
|
+
/**
|
1572
|
+
* Load a PNG image directly.
|
1573
|
+
*
|
1574
|
+
* If you know you definitely have a PNG image, you can call this function,
|
1575
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1576
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1577
|
+
* interface available here.
|
1578
|
+
*
|
1579
|
+
* \param src an SDL_RWops to load image data from.
|
1580
|
+
* \returns SDL surface, or NULL on error
|
1581
|
+
*
|
1582
|
+
* \since This function is available since SDL_image 2.0.0.
|
1583
|
+
*
|
1584
|
+
* \sa IMG_LoadAVIF_RW
|
1585
|
+
* \sa IMG_LoadICO_RW
|
1586
|
+
* \sa IMG_LoadCUR_RW
|
1587
|
+
* \sa IMG_LoadBMP_RW
|
1588
|
+
* \sa IMG_LoadGIF_RW
|
1589
|
+
* \sa IMG_LoadJPG_RW
|
1590
|
+
* \sa IMG_LoadJXL_RW
|
1591
|
+
* \sa IMG_LoadLBM_RW
|
1592
|
+
* \sa IMG_LoadPCX_RW
|
1593
|
+
* \sa IMG_LoadPNM_RW
|
1594
|
+
* \sa IMG_LoadSVG_RW
|
1595
|
+
* \sa IMG_LoadQOI_RW
|
1596
|
+
* \sa IMG_LoadTGA_RW
|
1597
|
+
* \sa IMG_LoadTIF_RW
|
1598
|
+
* \sa IMG_LoadXCF_RW
|
1599
|
+
* \sa IMG_LoadXPM_RW
|
1600
|
+
* \sa IMG_LoadXV_RW
|
1601
|
+
* \sa IMG_LoadWEBP_RW
|
1602
|
+
*/
|
1603
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNG_RW(SDL_RWops *src);
|
1604
|
+
|
1605
|
+
/**
|
1606
|
+
* Load a PNM image directly.
|
1607
|
+
*
|
1608
|
+
* If you know you definitely have a PNM image, you can call this function,
|
1609
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1610
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1611
|
+
* interface available here.
|
1612
|
+
*
|
1613
|
+
* \param src an SDL_RWops to load image data from.
|
1614
|
+
* \returns SDL surface, or NULL on error
|
1615
|
+
*
|
1616
|
+
* \since This function is available since SDL_image 2.0.0.
|
1617
|
+
*
|
1618
|
+
* \sa IMG_LoadAVIF_RW
|
1619
|
+
* \sa IMG_LoadICO_RW
|
1620
|
+
* \sa IMG_LoadCUR_RW
|
1621
|
+
* \sa IMG_LoadBMP_RW
|
1622
|
+
* \sa IMG_LoadGIF_RW
|
1623
|
+
* \sa IMG_LoadJPG_RW
|
1624
|
+
* \sa IMG_LoadJXL_RW
|
1625
|
+
* \sa IMG_LoadLBM_RW
|
1626
|
+
* \sa IMG_LoadPCX_RW
|
1627
|
+
* \sa IMG_LoadPNG_RW
|
1628
|
+
* \sa IMG_LoadSVG_RW
|
1629
|
+
* \sa IMG_LoadQOI_RW
|
1630
|
+
* \sa IMG_LoadTGA_RW
|
1631
|
+
* \sa IMG_LoadTIF_RW
|
1632
|
+
* \sa IMG_LoadXCF_RW
|
1633
|
+
* \sa IMG_LoadXPM_RW
|
1634
|
+
* \sa IMG_LoadXV_RW
|
1635
|
+
* \sa IMG_LoadWEBP_RW
|
1636
|
+
*/
|
1637
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadPNM_RW(SDL_RWops *src);
|
1638
|
+
|
1639
|
+
/**
|
1640
|
+
* Load a SVG image directly.
|
1641
|
+
*
|
1642
|
+
* If you know you definitely have a SVG image, you can call this function,
|
1643
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1644
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1645
|
+
* interface available here.
|
1646
|
+
*
|
1647
|
+
* \param src an SDL_RWops to load image data from.
|
1648
|
+
* \returns SDL surface, or NULL on error
|
1649
|
+
*
|
1650
|
+
* \since This function is available since SDL_image 2.0.2.
|
1651
|
+
*
|
1652
|
+
* \sa IMG_LoadAVIF_RW
|
1653
|
+
* \sa IMG_LoadICO_RW
|
1654
|
+
* \sa IMG_LoadCUR_RW
|
1655
|
+
* \sa IMG_LoadBMP_RW
|
1656
|
+
* \sa IMG_LoadGIF_RW
|
1657
|
+
* \sa IMG_LoadJPG_RW
|
1658
|
+
* \sa IMG_LoadJXL_RW
|
1659
|
+
* \sa IMG_LoadLBM_RW
|
1660
|
+
* \sa IMG_LoadPCX_RW
|
1661
|
+
* \sa IMG_LoadPNG_RW
|
1662
|
+
* \sa IMG_LoadPNM_RW
|
1663
|
+
* \sa IMG_LoadQOI_RW
|
1664
|
+
* \sa IMG_LoadTGA_RW
|
1665
|
+
* \sa IMG_LoadTIF_RW
|
1666
|
+
* \sa IMG_LoadXCF_RW
|
1667
|
+
* \sa IMG_LoadXPM_RW
|
1668
|
+
* \sa IMG_LoadXV_RW
|
1669
|
+
* \sa IMG_LoadWEBP_RW
|
1670
|
+
*/
|
1671
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadSVG_RW(SDL_RWops *src);
|
1672
|
+
|
1673
|
+
/**
|
1674
|
+
* Load a QOI image directly.
|
1675
|
+
*
|
1676
|
+
* If you know you definitely have a QOI image, you can call this function,
|
1677
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1678
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1679
|
+
* interface available here.
|
1680
|
+
*
|
1681
|
+
* \param src an SDL_RWops to load image data from.
|
1682
|
+
* \returns SDL surface, or NULL on error
|
1683
|
+
*
|
1684
|
+
* \since This function is available since SDL_image 2.6.0.
|
1685
|
+
*
|
1686
|
+
* \sa IMG_LoadAVIF_RW
|
1687
|
+
* \sa IMG_LoadICO_RW
|
1688
|
+
* \sa IMG_LoadCUR_RW
|
1689
|
+
* \sa IMG_LoadBMP_RW
|
1690
|
+
* \sa IMG_LoadGIF_RW
|
1691
|
+
* \sa IMG_LoadJPG_RW
|
1692
|
+
* \sa IMG_LoadJXL_RW
|
1693
|
+
* \sa IMG_LoadLBM_RW
|
1694
|
+
* \sa IMG_LoadPCX_RW
|
1695
|
+
* \sa IMG_LoadPNG_RW
|
1696
|
+
* \sa IMG_LoadPNM_RW
|
1697
|
+
* \sa IMG_LoadSVG_RW
|
1698
|
+
* \sa IMG_LoadTGA_RW
|
1699
|
+
* \sa IMG_LoadTIF_RW
|
1700
|
+
* \sa IMG_LoadXCF_RW
|
1701
|
+
* \sa IMG_LoadXPM_RW
|
1702
|
+
* \sa IMG_LoadXV_RW
|
1703
|
+
* \sa IMG_LoadWEBP_RW
|
1704
|
+
*/
|
1705
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadQOI_RW(SDL_RWops *src);
|
1706
|
+
|
1707
|
+
/**
|
1708
|
+
* Load a TGA image directly.
|
1709
|
+
*
|
1710
|
+
* If you know you definitely have a TGA image, you can call this function,
|
1711
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1712
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1713
|
+
* interface available here.
|
1714
|
+
*
|
1715
|
+
* \param src an SDL_RWops to load image data from.
|
1716
|
+
* \returns SDL surface, or NULL on error
|
1717
|
+
*
|
1718
|
+
* \since This function is available since SDL_image 2.0.0.
|
1719
|
+
*
|
1720
|
+
* \sa IMG_LoadAVIF_RW
|
1721
|
+
* \sa IMG_LoadICO_RW
|
1722
|
+
* \sa IMG_LoadCUR_RW
|
1723
|
+
* \sa IMG_LoadBMP_RW
|
1724
|
+
* \sa IMG_LoadGIF_RW
|
1725
|
+
* \sa IMG_LoadJPG_RW
|
1726
|
+
* \sa IMG_LoadJXL_RW
|
1727
|
+
* \sa IMG_LoadLBM_RW
|
1728
|
+
* \sa IMG_LoadPCX_RW
|
1729
|
+
* \sa IMG_LoadPNG_RW
|
1730
|
+
* \sa IMG_LoadPNM_RW
|
1731
|
+
* \sa IMG_LoadSVG_RW
|
1732
|
+
* \sa IMG_LoadQOI_RW
|
1733
|
+
* \sa IMG_LoadTIF_RW
|
1734
|
+
* \sa IMG_LoadXCF_RW
|
1735
|
+
* \sa IMG_LoadXPM_RW
|
1736
|
+
* \sa IMG_LoadXV_RW
|
1737
|
+
* \sa IMG_LoadWEBP_RW
|
1738
|
+
*/
|
1739
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTGA_RW(SDL_RWops *src);
|
1740
|
+
|
1741
|
+
/**
|
1742
|
+
* Load a TIFF image directly.
|
1743
|
+
*
|
1744
|
+
* If you know you definitely have a TIFF image, you can call this function,
|
1745
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1746
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1747
|
+
* interface available here.
|
1748
|
+
*
|
1749
|
+
* \param src an SDL_RWops to load image data from.
|
1750
|
+
* \returns SDL surface, or NULL on error
|
1751
|
+
*
|
1752
|
+
* \since This function is available since SDL_image 2.0.0.
|
1753
|
+
*
|
1754
|
+
* \sa IMG_LoadAVIF_RW
|
1755
|
+
* \sa IMG_LoadICO_RW
|
1756
|
+
* \sa IMG_LoadCUR_RW
|
1757
|
+
* \sa IMG_LoadBMP_RW
|
1758
|
+
* \sa IMG_LoadGIF_RW
|
1759
|
+
* \sa IMG_LoadJPG_RW
|
1760
|
+
* \sa IMG_LoadJXL_RW
|
1761
|
+
* \sa IMG_LoadLBM_RW
|
1762
|
+
* \sa IMG_LoadPCX_RW
|
1763
|
+
* \sa IMG_LoadPNG_RW
|
1764
|
+
* \sa IMG_LoadPNM_RW
|
1765
|
+
* \sa IMG_LoadSVG_RW
|
1766
|
+
* \sa IMG_LoadQOI_RW
|
1767
|
+
* \sa IMG_LoadTGA_RW
|
1768
|
+
* \sa IMG_LoadXCF_RW
|
1769
|
+
* \sa IMG_LoadXPM_RW
|
1770
|
+
* \sa IMG_LoadXV_RW
|
1771
|
+
* \sa IMG_LoadWEBP_RW
|
1772
|
+
*/
|
1773
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadTIF_RW(SDL_RWops *src);
|
1774
|
+
|
1775
|
+
/**
|
1776
|
+
* Load a XCF image directly.
|
1777
|
+
*
|
1778
|
+
* If you know you definitely have a XCF image, you can call this function,
|
1779
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1780
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1781
|
+
* interface available here.
|
1782
|
+
*
|
1783
|
+
* \param src an SDL_RWops to load image data from.
|
1784
|
+
* \returns SDL surface, or NULL on error
|
1785
|
+
*
|
1786
|
+
* \since This function is available since SDL_image 2.0.0.
|
1787
|
+
*
|
1788
|
+
* \sa IMG_LoadAVIF_RW
|
1789
|
+
* \sa IMG_LoadICO_RW
|
1790
|
+
* \sa IMG_LoadCUR_RW
|
1791
|
+
* \sa IMG_LoadBMP_RW
|
1792
|
+
* \sa IMG_LoadGIF_RW
|
1793
|
+
* \sa IMG_LoadJPG_RW
|
1794
|
+
* \sa IMG_LoadJXL_RW
|
1795
|
+
* \sa IMG_LoadLBM_RW
|
1796
|
+
* \sa IMG_LoadPCX_RW
|
1797
|
+
* \sa IMG_LoadPNG_RW
|
1798
|
+
* \sa IMG_LoadPNM_RW
|
1799
|
+
* \sa IMG_LoadSVG_RW
|
1800
|
+
* \sa IMG_LoadQOI_RW
|
1801
|
+
* \sa IMG_LoadTGA_RW
|
1802
|
+
* \sa IMG_LoadTIF_RW
|
1803
|
+
* \sa IMG_LoadXPM_RW
|
1804
|
+
* \sa IMG_LoadXV_RW
|
1805
|
+
* \sa IMG_LoadWEBP_RW
|
1806
|
+
*/
|
1807
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXCF_RW(SDL_RWops *src);
|
1808
|
+
|
1809
|
+
/**
|
1810
|
+
* Load a XPM image directly.
|
1811
|
+
*
|
1812
|
+
* If you know you definitely have a XPM image, you can call this function,
|
1813
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1814
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1815
|
+
* interface available here.
|
1816
|
+
*
|
1817
|
+
* \param src an SDL_RWops to load image data from.
|
1818
|
+
* \returns SDL surface, or NULL on error
|
1819
|
+
*
|
1820
|
+
* \since This function is available since SDL_image 2.0.0.
|
1821
|
+
*
|
1822
|
+
* \sa IMG_LoadAVIF_RW
|
1823
|
+
* \sa IMG_LoadICO_RW
|
1824
|
+
* \sa IMG_LoadCUR_RW
|
1825
|
+
* \sa IMG_LoadBMP_RW
|
1826
|
+
* \sa IMG_LoadGIF_RW
|
1827
|
+
* \sa IMG_LoadJPG_RW
|
1828
|
+
* \sa IMG_LoadJXL_RW
|
1829
|
+
* \sa IMG_LoadLBM_RW
|
1830
|
+
* \sa IMG_LoadPCX_RW
|
1831
|
+
* \sa IMG_LoadPNG_RW
|
1832
|
+
* \sa IMG_LoadPNM_RW
|
1833
|
+
* \sa IMG_LoadSVG_RW
|
1834
|
+
* \sa IMG_LoadQOI_RW
|
1835
|
+
* \sa IMG_LoadTGA_RW
|
1836
|
+
* \sa IMG_LoadTIF_RW
|
1837
|
+
* \sa IMG_LoadXCF_RW
|
1838
|
+
* \sa IMG_LoadXV_RW
|
1839
|
+
* \sa IMG_LoadWEBP_RW
|
1840
|
+
*/
|
1841
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXPM_RW(SDL_RWops *src);
|
1842
|
+
|
1843
|
+
/**
|
1844
|
+
* Load a XV image directly.
|
1845
|
+
*
|
1846
|
+
* If you know you definitely have a XV image, you can call this function,
|
1847
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1848
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1849
|
+
* interface available here.
|
1850
|
+
*
|
1851
|
+
* \param src an SDL_RWops to load image data from.
|
1852
|
+
* \returns SDL surface, or NULL on error
|
1853
|
+
*
|
1854
|
+
* \since This function is available since SDL_image 2.0.0.
|
1855
|
+
*
|
1856
|
+
* \sa IMG_LoadAVIF_RW
|
1857
|
+
* \sa IMG_LoadICO_RW
|
1858
|
+
* \sa IMG_LoadCUR_RW
|
1859
|
+
* \sa IMG_LoadBMP_RW
|
1860
|
+
* \sa IMG_LoadGIF_RW
|
1861
|
+
* \sa IMG_LoadJPG_RW
|
1862
|
+
* \sa IMG_LoadJXL_RW
|
1863
|
+
* \sa IMG_LoadLBM_RW
|
1864
|
+
* \sa IMG_LoadPCX_RW
|
1865
|
+
* \sa IMG_LoadPNG_RW
|
1866
|
+
* \sa IMG_LoadPNM_RW
|
1867
|
+
* \sa IMG_LoadSVG_RW
|
1868
|
+
* \sa IMG_LoadQOI_RW
|
1869
|
+
* \sa IMG_LoadTGA_RW
|
1870
|
+
* \sa IMG_LoadTIF_RW
|
1871
|
+
* \sa IMG_LoadXCF_RW
|
1872
|
+
* \sa IMG_LoadXPM_RW
|
1873
|
+
* \sa IMG_LoadWEBP_RW
|
1874
|
+
*/
|
1875
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadXV_RW(SDL_RWops *src);
|
1876
|
+
|
1877
|
+
/**
|
1878
|
+
* Load a WEBP image directly.
|
1879
|
+
*
|
1880
|
+
* If you know you definitely have a WEBP image, you can call this function,
|
1881
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
1882
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
1883
|
+
* interface available here.
|
1884
|
+
*
|
1885
|
+
* \param src an SDL_RWops to load image data from.
|
1886
|
+
* \returns SDL surface, or NULL on error
|
1887
|
+
*
|
1888
|
+
* \since This function is available since SDL_image 2.0.0.
|
1889
|
+
*
|
1890
|
+
* \sa IMG_LoadAVIF_RW
|
1891
|
+
* \sa IMG_LoadICO_RW
|
1892
|
+
* \sa IMG_LoadCUR_RW
|
1893
|
+
* \sa IMG_LoadBMP_RW
|
1894
|
+
* \sa IMG_LoadGIF_RW
|
1895
|
+
* \sa IMG_LoadJPG_RW
|
1896
|
+
* \sa IMG_LoadJXL_RW
|
1897
|
+
* \sa IMG_LoadLBM_RW
|
1898
|
+
* \sa IMG_LoadPCX_RW
|
1899
|
+
* \sa IMG_LoadPNG_RW
|
1900
|
+
* \sa IMG_LoadPNM_RW
|
1901
|
+
* \sa IMG_LoadSVG_RW
|
1902
|
+
* \sa IMG_LoadQOI_RW
|
1903
|
+
* \sa IMG_LoadTGA_RW
|
1904
|
+
* \sa IMG_LoadTIF_RW
|
1905
|
+
* \sa IMG_LoadXCF_RW
|
1906
|
+
* \sa IMG_LoadXPM_RW
|
1907
|
+
* \sa IMG_LoadXV_RW
|
1908
|
+
*/
|
1909
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadWEBP_RW(SDL_RWops *src);
|
1910
|
+
|
1911
|
+
/**
|
1912
|
+
* Load an SVG image, scaled to a specific size.
|
1913
|
+
*
|
1914
|
+
* Since SVG files are resolution-independent, you specify the size you would
|
1915
|
+
* like the output image to be and it will be generated at those dimensions.
|
1916
|
+
*
|
1917
|
+
* Either width or height may be 0 and the image will be auto-sized to
|
1918
|
+
* preserve aspect ratio.
|
1919
|
+
*
|
1920
|
+
* When done with the returned surface, the app should dispose of it with a
|
1921
|
+
* call to SDL_FreeSurface().
|
1922
|
+
*
|
1923
|
+
* \param src an SDL_RWops to load SVG data from.
|
1924
|
+
* \param width desired width of the generated surface, in pixels.
|
1925
|
+
* \param height desired height of the generated surface, in pixels.
|
1926
|
+
* \returns a new SDL surface, or NULL on error.
|
1927
|
+
*
|
1928
|
+
* \since This function is available since SDL_image 2.6.0.
|
1929
|
+
*/
|
1930
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_LoadSizedSVG_RW(SDL_RWops *src, int width, int height);
|
1931
|
+
|
1932
|
+
/**
|
1933
|
+
* Load an XPM image from a memory array.
|
1934
|
+
*
|
1935
|
+
* The returned surface will be an 8bpp indexed surface, if possible,
|
1936
|
+
* otherwise it will be 32bpp. If you always want 32-bit data, use
|
1937
|
+
* IMG_ReadXPMFromArrayToRGB888() instead.
|
1938
|
+
*
|
1939
|
+
* When done with the returned surface, the app should dispose of it with a
|
1940
|
+
* call to SDL_FreeSurface().
|
1941
|
+
*
|
1942
|
+
* \param xpm a null-terminated array of strings that comprise XPM data.
|
1943
|
+
* \returns a new SDL surface, or NULL on error.
|
1944
|
+
*
|
1945
|
+
* \since This function is available since SDL_image 2.0.0.
|
1946
|
+
*
|
1947
|
+
* \sa IMG_ReadXPMFromArrayToRGB888
|
1948
|
+
*/
|
1949
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArray(char **xpm);
|
1950
|
+
|
1951
|
+
/**
|
1952
|
+
* Load an XPM image from a memory array.
|
1953
|
+
*
|
1954
|
+
* The returned surface will always be a 32-bit RGB surface. If you want 8-bit
|
1955
|
+
* indexed colors (and the XPM data allows it), use IMG_ReadXPMFromArray()
|
1956
|
+
* instead.
|
1957
|
+
*
|
1958
|
+
* When done with the returned surface, the app should dispose of it with a
|
1959
|
+
* call to SDL_FreeSurface().
|
1960
|
+
*
|
1961
|
+
* \param xpm a null-terminated array of strings that comprise XPM data.
|
1962
|
+
* \returns a new SDL surface, or NULL on error.
|
1963
|
+
*
|
1964
|
+
* \since This function is available since SDL_image 2.6.0.
|
1965
|
+
*
|
1966
|
+
* \sa IMG_ReadXPMFromArray
|
1967
|
+
*/
|
1968
|
+
extern DECLSPEC SDL_Surface * SDLCALL IMG_ReadXPMFromArrayToRGB888(char **xpm);
|
1969
|
+
|
1970
|
+
/**
|
1971
|
+
* Save an SDL_Surface into a PNG image file.
|
1972
|
+
*
|
1973
|
+
* If the file already exists, it will be overwritten.
|
1974
|
+
*
|
1975
|
+
* \param surface the SDL surface to save
|
1976
|
+
* \param file path on the filesystem to write new file to.
|
1977
|
+
* \returns 0 if successful, -1 on error
|
1978
|
+
*
|
1979
|
+
* \since This function is available since SDL_image 2.0.0.
|
1980
|
+
*
|
1981
|
+
* \sa IMG_SavePNG_RW
|
1982
|
+
* \sa IMG_SaveJPG
|
1983
|
+
* \sa IMG_SaveJPG_RW
|
1984
|
+
*/
|
1985
|
+
extern DECLSPEC int SDLCALL IMG_SavePNG(SDL_Surface *surface, const char *file);
|
1986
|
+
|
1987
|
+
/**
|
1988
|
+
* Save an SDL_Surface into PNG image data, via an SDL_RWops.
|
1989
|
+
*
|
1990
|
+
* If you just want to save to a filename, you can use IMG_SavePNG() instead.
|
1991
|
+
*
|
1992
|
+
* \param surface the SDL surface to save
|
1993
|
+
* \param dst the SDL_RWops to save the image data to.
|
1994
|
+
* \returns 0 if successful, -1 on error.
|
1995
|
+
*
|
1996
|
+
* \since This function is available since SDL_image 2.0.0.
|
1997
|
+
*
|
1998
|
+
* \sa IMG_SavePNG
|
1999
|
+
* \sa IMG_SaveJPG
|
2000
|
+
* \sa IMG_SaveJPG_RW
|
2001
|
+
*/
|
2002
|
+
extern DECLSPEC int SDLCALL IMG_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst);
|
2003
|
+
|
2004
|
+
/**
|
2005
|
+
* Save an SDL_Surface into a JPEG image file.
|
2006
|
+
*
|
2007
|
+
* If the file already exists, it will be overwritten.
|
2008
|
+
*
|
2009
|
+
* \param surface the SDL surface to save
|
2010
|
+
* \param file path on the filesystem to write new file to.
|
2011
|
+
* \param quality [0; 33] is Lowest quality, [34; 66] is Middle quality, [67;
|
2012
|
+
* 100] is Highest quality
|
2013
|
+
* \returns 0 if successful, -1 on error
|
2014
|
+
*
|
2015
|
+
* \since This function is available since SDL_image 2.0.2.
|
2016
|
+
*
|
2017
|
+
* \sa IMG_SaveJPG_RW
|
2018
|
+
* \sa IMG_SavePNG
|
2019
|
+
* \sa IMG_SavePNG_RW
|
2020
|
+
*/
|
2021
|
+
extern DECLSPEC int SDLCALL IMG_SaveJPG(SDL_Surface *surface, const char *file, int quality);
|
2022
|
+
|
2023
|
+
/**
|
2024
|
+
* Save an SDL_Surface into JPEG image data, via an SDL_RWops.
|
2025
|
+
*
|
2026
|
+
* If you just want to save to a filename, you can use IMG_SaveJPG() instead.
|
2027
|
+
*
|
2028
|
+
* \param surface the SDL surface to save
|
2029
|
+
* \param dst the SDL_RWops to save the image data to.
|
2030
|
+
* \returns 0 if successful, -1 on error.
|
2031
|
+
*
|
2032
|
+
* \since This function is available since SDL_image 2.0.2.
|
2033
|
+
*
|
2034
|
+
* \sa IMG_SaveJPG
|
2035
|
+
* \sa IMG_SavePNG
|
2036
|
+
* \sa IMG_SavePNG_RW
|
2037
|
+
*/
|
2038
|
+
extern DECLSPEC int SDLCALL IMG_SaveJPG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst, int quality);
|
2039
|
+
|
2040
|
+
/**
|
2041
|
+
* Animated image support
|
2042
|
+
* Currently only animated GIFs are supported.
|
2043
|
+
*/
|
2044
|
+
typedef struct
|
2045
|
+
{
|
2046
|
+
int w, h;
|
2047
|
+
int count;
|
2048
|
+
SDL_Surface **frames;
|
2049
|
+
int *delays;
|
2050
|
+
} IMG_Animation;
|
2051
|
+
|
2052
|
+
/**
|
2053
|
+
* Load an animation from a file.
|
2054
|
+
*
|
2055
|
+
* When done with the returned animation, the app should dispose of it with a
|
2056
|
+
* call to IMG_FreeAnimation().
|
2057
|
+
*
|
2058
|
+
* \param file path on the filesystem containing an animated image.
|
2059
|
+
* \returns a new IMG_Animation, or NULL on error.
|
2060
|
+
*
|
2061
|
+
* \since This function is available since SDL_image 2.6.0.
|
2062
|
+
*
|
2063
|
+
* \sa IMG_FreeAnimation
|
2064
|
+
*/
|
2065
|
+
extern DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation(const char *file);
|
2066
|
+
|
2067
|
+
/**
|
2068
|
+
* Load an animation from an SDL_RWops.
|
2069
|
+
*
|
2070
|
+
* If `freesrc` is non-zero, the RWops will be closed before returning,
|
2071
|
+
* whether this function succeeds or not. SDL_image reads everything it needs
|
2072
|
+
* from the RWops during this call in any case.
|
2073
|
+
*
|
2074
|
+
* When done with the returned animation, the app should dispose of it with a
|
2075
|
+
* call to IMG_FreeAnimation().
|
2076
|
+
*
|
2077
|
+
* \param src an SDL_RWops that data will be read from.
|
2078
|
+
* \param freesrc non-zero to close/free the SDL_RWops before returning, zero
|
2079
|
+
* to leave it open.
|
2080
|
+
* \returns a new IMG_Animation, or NULL on error.
|
2081
|
+
*
|
2082
|
+
* \since This function is available since SDL_image 2.6.0.
|
2083
|
+
*
|
2084
|
+
* \sa IMG_FreeAnimation
|
2085
|
+
*/
|
2086
|
+
extern DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimation_RW(SDL_RWops *src, int freesrc);
|
2087
|
+
|
2088
|
+
/**
|
2089
|
+
* Load an animation from an SDL datasource
|
2090
|
+
*
|
2091
|
+
* Even though this function accepts a file type, SDL_image may still try
|
2092
|
+
* other decoders that are capable of detecting file type from the contents of
|
2093
|
+
* the image data, but may rely on the caller-provided type string for formats
|
2094
|
+
* that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
|
2095
|
+
* its ability to guess the format.
|
2096
|
+
*
|
2097
|
+
* If `freesrc` is non-zero, the RWops will be closed before returning,
|
2098
|
+
* whether this function succeeds or not. SDL_image reads everything it needs
|
2099
|
+
* from the RWops during this call in any case.
|
2100
|
+
*
|
2101
|
+
* When done with the returned animation, the app should dispose of it with a
|
2102
|
+
* call to IMG_FreeAnimation().
|
2103
|
+
*
|
2104
|
+
* \param src an SDL_RWops that data will be read from.
|
2105
|
+
* \param freesrc non-zero to close/free the SDL_RWops before returning, zero
|
2106
|
+
* to leave it open.
|
2107
|
+
* \param type a filename extension that represent this data ("GIF", etc).
|
2108
|
+
* \returns a new IMG_Animation, or NULL on error.
|
2109
|
+
*
|
2110
|
+
* \since This function is available since SDL_image 2.6.0.
|
2111
|
+
*
|
2112
|
+
* \sa IMG_LoadAnimation
|
2113
|
+
* \sa IMG_LoadAnimation_RW
|
2114
|
+
* \sa IMG_FreeAnimation
|
2115
|
+
*/
|
2116
|
+
extern DECLSPEC IMG_Animation * SDLCALL IMG_LoadAnimationTyped_RW(SDL_RWops *src, int freesrc, const char *type);
|
2117
|
+
|
2118
|
+
/**
|
2119
|
+
* Dispose of an IMG_Animation and free its resources.
|
2120
|
+
*
|
2121
|
+
* The provided `anim` pointer is not valid once this call returns.
|
2122
|
+
*
|
2123
|
+
* \param anim IMG_Animation to dispose of.
|
2124
|
+
*
|
2125
|
+
* \since This function is available since SDL_image 2.6.0.
|
2126
|
+
*
|
2127
|
+
* \sa IMG_LoadAnimation
|
2128
|
+
* \sa IMG_LoadAnimation_RW
|
2129
|
+
* \sa IMG_LoadAnimationTyped_RW
|
2130
|
+
*/
|
2131
|
+
extern DECLSPEC void SDLCALL IMG_FreeAnimation(IMG_Animation *anim);
|
2132
|
+
|
2133
|
+
/**
|
2134
|
+
* Load a GIF animation directly.
|
2135
|
+
*
|
2136
|
+
* If you know you definitely have a GIF image, you can call this function,
|
2137
|
+
* which will skip SDL_image's file format detection routines. Generally it's
|
2138
|
+
* better to use the abstract interfaces; also, there is only an SDL_RWops
|
2139
|
+
* interface available here.
|
2140
|
+
*
|
2141
|
+
* \param src an SDL_RWops that data will be read from.
|
2142
|
+
* \returns a new IMG_Animation, or NULL on error.
|
2143
|
+
*
|
2144
|
+
* \since This function is available since SDL_image 2.6.0.
|
2145
|
+
*
|
2146
|
+
* \sa IMG_LoadAnimation
|
2147
|
+
* \sa IMG_LoadAnimation_RW
|
2148
|
+
* \sa IMG_LoadAnimationTyped_RW
|
2149
|
+
* \sa IMG_FreeAnimation
|
2150
|
+
*/
|
2151
|
+
extern DECLSPEC IMG_Animation * SDLCALL IMG_LoadGIFAnimation_RW(SDL_RWops *src);
|
2152
|
+
|
2153
|
+
/**
|
2154
|
+
* Report SDL_image errors
|
2155
|
+
*
|
2156
|
+
* \sa IMG_GetError
|
2157
|
+
*/
|
2158
|
+
#define IMG_SetError SDL_SetError
|
2159
|
+
|
2160
|
+
/**
|
2161
|
+
* Get last SDL_image error
|
2162
|
+
*
|
2163
|
+
* \sa IMG_SetError
|
2164
|
+
*/
|
2165
|
+
#define IMG_GetError SDL_GetError
|
2166
|
+
|
2167
|
+
/* Ends C function definitions when using C++ */
|
2168
|
+
#ifdef __cplusplus
|
2169
|
+
}
|
2170
|
+
#endif
|
2171
|
+
#include "close_code.h"
|
2172
|
+
|
2173
|
+
#endif /* SDL_IMAGE_H_ */
|