sdl3_image_sys/generated/image.rs
1//! Header file for SDL_image library
2//!
3//! A simple library to load images of various formats as SDL surfaces
4
5use sdl3_sys::everything::*;
6
7/// * Printable format: "%d.%d.%d", MAJOR, MINOR, MICRO
8pub const SDL_IMAGE_MAJOR_VERSION: ::core::primitive::i32 = 3;
9
10pub const SDL_IMAGE_MINOR_VERSION: ::core::primitive::i32 = 4;
11
12pub const SDL_IMAGE_MICRO_VERSION: ::core::primitive::i32 = 0;
13
14/// * This is the version number macro for the current SDL_image version.
15pub const SDL_IMAGE_VERSION: ::core::primitive::i32 = SDL_VERSIONNUM(
16 SDL_IMAGE_MAJOR_VERSION,
17 SDL_IMAGE_MINOR_VERSION,
18 SDL_IMAGE_MICRO_VERSION,
19);
20
21/// * This macro will evaluate to true if compiled with SDL_image at least X.Y.Z.
22#[inline(always)]
23pub const fn SDL_IMAGE_VERSION_ATLEAST(
24 X: ::core::primitive::i32,
25 Y: ::core::primitive::i32,
26 Z: ::core::primitive::i32,
27) -> ::core::primitive::bool {
28 (((SDL_IMAGE_MAJOR_VERSION >= X)
29 && ((SDL_IMAGE_MAJOR_VERSION > X) || (SDL_IMAGE_MINOR_VERSION >= Y)))
30 && (((SDL_IMAGE_MAJOR_VERSION > X) || (SDL_IMAGE_MINOR_VERSION > Y))
31 || (SDL_IMAGE_MICRO_VERSION >= Z)))
32}
33
34unsafe extern "C" {
35 /// This function gets the version of the dynamically linked SDL_image library.
36 ///
37 /// ## Return value
38 /// Returns SDL_image version.
39 ///
40 /// ## Availability
41 /// This function is available since SDL_image 3.0.0.
42 pub safe fn IMG_Version() -> ::core::ffi::c_int;
43}
44
45unsafe extern "C" {
46 /// Load an image from a filesystem path into a software surface.
47 ///
48 /// An [`SDL_Surface`] is a buffer of pixels in memory accessible by the CPU. Use
49 /// this if you plan to hand the data to something else or manipulate it
50 /// further in code.
51 ///
52 /// There are no guarantees about what format the new [`SDL_Surface`] data will be;
53 /// in many cases, SDL_image will attempt to supply a surface that exactly
54 /// matches the provided image, but in others it might have to convert (either
55 /// because the image is in a format that SDL doesn't directly support or
56 /// because it's compressed data that could reasonably uncompress to various
57 /// formats and SDL_image had to pick one). You can inspect an [`SDL_Surface`] for
58 /// its specifics, and use [`SDL_ConvertSurface`] to then migrate to any supported
59 /// format.
60 ///
61 /// If the image format supports a transparent pixel, SDL will set the colorkey
62 /// for the surface. You can enable RLE acceleration on the surface afterwards
63 /// by calling: SDL_SetSurfaceColorKey(image, [`SDL_RLEACCEL`],
64 /// image->format->colorkey);
65 ///
66 /// There is a separate function to read files from an [`SDL_IOStream`], if you
67 /// need an i/o abstraction to provide data from anywhere instead of a simple
68 /// filesystem read; that function is [`IMG_Load_IO()`].
69 ///
70 /// If you are using SDL's 2D rendering API, there is an equivalent call to
71 /// load images directly into an [`SDL_Texture`] for use by the GPU without using a
72 /// software surface: call [`IMG_LoadTexture()`] instead.
73 ///
74 /// When done with the returned surface, the app should dispose of it with a
75 /// call to
76 /// [SDL_DestroySurface](https://wiki.libsdl.org/SDL3/SDL_DestroySurface)
77 /// ().
78 ///
79 /// ## Parameters
80 /// - `file`: a path on the filesystem to load an image from.
81 ///
82 /// ## Return value
83 /// Returns a new SDL surface, or NULL on error.
84 ///
85 /// ## Availability
86 /// This function is available since SDL_image 3.0.0.
87 ///
88 /// ## See also
89 /// - [`IMG_LoadTyped_IO`]
90 /// - [`IMG_Load_IO`]
91 pub fn IMG_Load(file: *const ::core::ffi::c_char) -> *mut SDL_Surface;
92}
93
94unsafe extern "C" {
95 /// Load an image from an SDL data source into a software surface.
96 ///
97 /// An [`SDL_Surface`] is a buffer of pixels in memory accessible by the CPU. Use
98 /// this if you plan to hand the data to something else or manipulate it
99 /// further in code.
100 ///
101 /// There are no guarantees about what format the new [`SDL_Surface`] data will be;
102 /// in many cases, SDL_image will attempt to supply a surface that exactly
103 /// matches the provided image, but in others it might have to convert (either
104 /// because the image is in a format that SDL doesn't directly support or
105 /// because it's compressed data that could reasonably uncompress to various
106 /// formats and SDL_image had to pick one). You can inspect an [`SDL_Surface`] for
107 /// its specifics, and use [`SDL_ConvertSurface`] to then migrate to any supported
108 /// format.
109 ///
110 /// If the image format supports a transparent pixel, SDL will set the colorkey
111 /// for the surface. You can enable RLE acceleration on the surface afterwards
112 /// by calling: SDL_SetSurfaceColorKey(image, [`SDL_RLEACCEL`],
113 /// image->format->colorkey);
114 ///
115 /// If `closeio` is true, `src` will be closed before returning, whether this
116 /// function succeeds or not. SDL_image reads everything it needs from `src`
117 /// during this call in any case.
118 ///
119 /// There is a separate function to read files from disk without having to deal
120 /// with [`SDL_IOStream`]\: `IMG_Load("filename.jpg")` will call this function and
121 /// manage those details for you, determining the file type from the filename's
122 /// extension.
123 ///
124 /// There is also [`IMG_LoadTyped_IO()`], which is equivalent to this function
125 /// except a file extension (like "BMP", "JPG", etc) can be specified, in case
126 /// SDL_image cannot autodetect the file format.
127 ///
128 /// If you are using SDL's 2D rendering API, there is an equivalent call to
129 /// load images directly into an [`SDL_Texture`] for use by the GPU without using a
130 /// software surface: call [`IMG_LoadTexture_IO()`] instead.
131 ///
132 /// When done with the returned surface, the app should dispose of it with a
133 /// call to [`SDL_DestroySurface()`].
134 ///
135 /// ## Parameters
136 /// - `src`: an [`SDL_IOStream`] that data will be read from.
137 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
138 /// to leave it open.
139 ///
140 /// ## Return value
141 /// Returns a new SDL surface, or NULL on error.
142 ///
143 /// ## Availability
144 /// This function is available since SDL_image 3.0.0.
145 ///
146 /// ## See also
147 /// - [`IMG_Load`]
148 /// - [`IMG_LoadTyped_IO`]
149 pub fn IMG_Load_IO(
150 src: *mut SDL_IOStream,
151 closeio: ::core::primitive::bool,
152 ) -> *mut SDL_Surface;
153}
154
155unsafe extern "C" {
156 /// Load an image from an SDL data source into a software surface.
157 ///
158 /// An [`SDL_Surface`] is a buffer of pixels in memory accessible by the CPU. Use
159 /// this if you plan to hand the data to something else or manipulate it
160 /// further in code.
161 ///
162 /// There are no guarantees about what format the new [`SDL_Surface`] data will be;
163 /// in many cases, SDL_image will attempt to supply a surface that exactly
164 /// matches the provided image, but in others it might have to convert (either
165 /// because the image is in a format that SDL doesn't directly support or
166 /// because it's compressed data that could reasonably uncompress to various
167 /// formats and SDL_image had to pick one). You can inspect an [`SDL_Surface`] for
168 /// its specifics, and use [`SDL_ConvertSurface`] to then migrate to any supported
169 /// format.
170 ///
171 /// If the image format supports a transparent pixel, SDL will set the colorkey
172 /// for the surface. You can enable RLE acceleration on the surface afterwards
173 /// by calling: SDL_SetSurfaceColorKey(image, [`SDL_RLEACCEL`],
174 /// image->format->colorkey);
175 ///
176 /// If `closeio` is true, `src` will be closed before returning, whether this
177 /// function succeeds or not. SDL_image reads everything it needs from `src`
178 /// during this call in any case.
179 ///
180 /// Even though this function accepts a file type, SDL_image may still try
181 /// other decoders that are capable of detecting file type from the contents of
182 /// the image data, but may rely on the caller-provided type string for formats
183 /// that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
184 /// its ability to guess the format.
185 ///
186 /// There is a separate function to read files from disk without having to deal
187 /// with [`SDL_IOStream`]\: `IMG_Load("filename.jpg")` will call this function and
188 /// manage those details for you, determining the file type from the filename's
189 /// extension.
190 ///
191 /// There is also [`IMG_Load_IO()`], which is equivalent to this function except
192 /// that it will rely on SDL_image to determine what type of data it is
193 /// loading, much like passing a NULL for type.
194 ///
195 /// If you are using SDL's 2D rendering API, there is an equivalent call to
196 /// load images directly into an [`SDL_Texture`] for use by the GPU without using a
197 /// software surface: call [`IMG_LoadTextureTyped_IO()`] instead.
198 ///
199 /// When done with the returned surface, the app should dispose of it with a
200 /// call to [`SDL_DestroySurface()`].
201 ///
202 /// ## Parameters
203 /// - `src`: an [`SDL_IOStream`] that data will be read from.
204 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
205 /// to leave it open.
206 /// - `type`: a filename extension that represent this data ("BMP", "GIF",
207 /// "PNG", etc).
208 ///
209 /// ## Return value
210 /// Returns a new SDL surface, or NULL on error.
211 ///
212 /// ## Availability
213 /// This function is available since SDL_image 3.0.0.
214 ///
215 /// ## See also
216 /// - [`IMG_Load`]
217 /// - [`IMG_Load_IO`]
218 pub fn IMG_LoadTyped_IO(
219 src: *mut SDL_IOStream,
220 closeio: ::core::primitive::bool,
221 r#type: *const ::core::ffi::c_char,
222 ) -> *mut SDL_Surface;
223}
224
225unsafe extern "C" {
226 /// Load an image from a filesystem path into a texture.
227 ///
228 /// An [`SDL_Texture`] represents an image in GPU memory, usable by SDL's 2D Render
229 /// API. This can be significantly more efficient than using a CPU-bound
230 /// [`SDL_Surface`] if you don't need to manipulate the image directly after
231 /// loading it.
232 ///
233 /// If the loaded image has transparency or a colorkey, a texture with an alpha
234 /// channel will be created. Otherwise, SDL_image will attempt to create an
235 /// [`SDL_Texture`] in the most format that most reasonably represents the image
236 /// data (but in many cases, this will just end up being 32-bit RGB or 32-bit
237 /// RGBA).
238 ///
239 /// There is a separate function to read files from an [`SDL_IOStream`], if you
240 /// need an i/o abstraction to provide data from anywhere instead of a simple
241 /// filesystem read; that function is [`IMG_LoadTexture_IO()`].
242 ///
243 /// If you would rather decode an image to an [`SDL_Surface`] (a buffer of pixels
244 /// in CPU memory), call [`IMG_Load()`] instead.
245 ///
246 /// When done with the returned texture, the app should dispose of it with a
247 /// call to [`SDL_DestroyTexture()`].
248 ///
249 /// ## Parameters
250 /// - `renderer`: the [`SDL_Renderer`] to use to create the texture.
251 /// - `file`: a path on the filesystem to load an image from.
252 ///
253 /// ## Return value
254 /// Returns a new texture, or NULL on error.
255 ///
256 /// ## Availability
257 /// This function is available since SDL_image 3.0.0.
258 ///
259 /// ## See also
260 /// - [`IMG_LoadTextureTyped_IO`]
261 /// - [`IMG_LoadTexture_IO`]
262 pub fn IMG_LoadTexture(
263 renderer: *mut SDL_Renderer,
264 file: *const ::core::ffi::c_char,
265 ) -> *mut SDL_Texture;
266}
267
268unsafe extern "C" {
269 /// Load an image from an SDL data source into a texture.
270 ///
271 /// An [`SDL_Texture`] represents an image in GPU memory, usable by SDL's 2D Render
272 /// API. This can be significantly more efficient than using a CPU-bound
273 /// [`SDL_Surface`] if you don't need to manipulate the image directly after
274 /// loading it.
275 ///
276 /// If the loaded image has transparency or a colorkey, a texture with an alpha
277 /// channel will be created. Otherwise, SDL_image will attempt to create an
278 /// [`SDL_Texture`] in the most format that most reasonably represents the image
279 /// data (but in many cases, this will just end up being 32-bit RGB or 32-bit
280 /// RGBA).
281 ///
282 /// If `closeio` is true, `src` will be closed before returning, whether this
283 /// function succeeds or not. SDL_image reads everything it needs from `src`
284 /// during this call in any case.
285 ///
286 /// There is a separate function to read files from disk without having to deal
287 /// with [`SDL_IOStream`]\: `IMG_LoadTexture(renderer, "filename.jpg")` will call
288 /// this function and manage those details for you, determining the file type
289 /// from the filename's extension.
290 ///
291 /// There is also [`IMG_LoadTextureTyped_IO()`], which is equivalent to this
292 /// function except a file extension (like "BMP", "JPG", etc) can be specified,
293 /// in case SDL_image cannot autodetect the file format.
294 ///
295 /// If you would rather decode an image to an [`SDL_Surface`] (a buffer of pixels
296 /// in CPU memory), call [`IMG_Load()`] instead.
297 ///
298 /// When done with the returned texture, the app should dispose of it with a
299 /// call to [`SDL_DestroyTexture()`].
300 ///
301 /// ## Parameters
302 /// - `renderer`: the [`SDL_Renderer`] to use to create the texture.
303 /// - `src`: an [`SDL_IOStream`] that data will be read from.
304 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
305 /// to leave it open.
306 ///
307 /// ## Return value
308 /// Returns a new texture, or NULL on error.
309 ///
310 /// ## Availability
311 /// This function is available since SDL_image 3.0.0.
312 ///
313 /// ## See also
314 /// - [`IMG_LoadTexture`]
315 /// - [`IMG_LoadTextureTyped_IO`]
316 pub fn IMG_LoadTexture_IO(
317 renderer: *mut SDL_Renderer,
318 src: *mut SDL_IOStream,
319 closeio: ::core::primitive::bool,
320 ) -> *mut SDL_Texture;
321}
322
323unsafe extern "C" {
324 /// Load an image from an SDL data source into a texture.
325 ///
326 /// An [`SDL_Texture`] represents an image in GPU memory, usable by SDL's 2D Render
327 /// API. This can be significantly more efficient than using a CPU-bound
328 /// [`SDL_Surface`] if you don't need to manipulate the image directly after
329 /// loading it.
330 ///
331 /// If the loaded image has transparency or a colorkey, a texture with an alpha
332 /// channel will be created. Otherwise, SDL_image will attempt to create an
333 /// [`SDL_Texture`] in the most format that most reasonably represents the image
334 /// data (but in many cases, this will just end up being 32-bit RGB or 32-bit
335 /// RGBA).
336 ///
337 /// If `closeio` is true, `src` will be closed before returning, whether this
338 /// function succeeds or not. SDL_image reads everything it needs from `src`
339 /// during this call in any case.
340 ///
341 /// Even though this function accepts a file type, SDL_image may still try
342 /// other decoders that are capable of detecting file type from the contents of
343 /// the image data, but may rely on the caller-provided type string for formats
344 /// that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
345 /// its ability to guess the format.
346 ///
347 /// There is a separate function to read files from disk without having to deal
348 /// with [`SDL_IOStream`]\: `IMG_LoadTexture("filename.jpg")` will call this
349 /// function and manage those details for you, determining the file type from
350 /// the filename's extension.
351 ///
352 /// There is also [`IMG_LoadTexture_IO()`], which is equivalent to this function
353 /// except that it will rely on SDL_image to determine what type of data it is
354 /// loading, much like passing a NULL for type.
355 ///
356 /// If you would rather decode an image to an [`SDL_Surface`] (a buffer of pixels
357 /// in CPU memory), call [`IMG_LoadTyped_IO()`] instead.
358 ///
359 /// When done with the returned texture, the app should dispose of it with a
360 /// call to [`SDL_DestroyTexture()`].
361 ///
362 /// ## Parameters
363 /// - `renderer`: the [`SDL_Renderer`] to use to create the texture.
364 /// - `src`: an [`SDL_IOStream`] that data will be read from.
365 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
366 /// to leave it open.
367 /// - `type`: a filename extension that represent this data ("BMP", "GIF",
368 /// "PNG", etc).
369 ///
370 /// ## Return value
371 /// Returns a new texture, or NULL on error.
372 ///
373 /// ## Availability
374 /// This function is available since SDL_image 3.0.0.
375 ///
376 /// ## See also
377 /// - [`IMG_LoadTexture`]
378 /// - [`IMG_LoadTexture_IO`]
379 pub fn IMG_LoadTextureTyped_IO(
380 renderer: *mut SDL_Renderer,
381 src: *mut SDL_IOStream,
382 closeio: ::core::primitive::bool,
383 r#type: *const ::core::ffi::c_char,
384 ) -> *mut SDL_Texture;
385}
386
387unsafe extern "C" {
388 /// Load an image from a filesystem path into a GPU texture.
389 ///
390 /// An [`SDL_GPUTexture`] represents an image in GPU memory, usable by SDL's GPU
391 /// API. Regardless of the source format of the image, this function will
392 /// create a GPU texture with the format [`SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM`]
393 /// with no mip levels. It can be bound as a sampled texture from a graphics or
394 /// compute pipeline and as a a readonly storage texture in a compute pipeline.
395 ///
396 /// There is a separate function to read files from an [`SDL_IOStream`], if you
397 /// need an i/o abstraction to provide data from anywhere instead of a simple
398 /// filesystem read; that function is [`IMG_LoadGPUTexture_IO()`].
399 ///
400 /// When done with the returned texture, the app should dispose of it with a
401 /// call to [`SDL_ReleaseGPUTexture()`].
402 ///
403 /// ## Parameters
404 /// - `device`: the [`SDL_GPUDevice`] to use to create the GPU texture.
405 /// - `copy_pass`: the [`SDL_GPUCopyPass`] to use to upload the loaded image to
406 /// the GPU texture.
407 /// - `file`: a path on the filesystem to load an image from.
408 /// - `width`: a pointer filled in with the width of the GPU texture. may be
409 /// NULL.
410 /// - `height`: a pointer filled in with the width of the GPU texture. may be
411 /// NULL.
412 ///
413 /// ## Return value
414 /// Returns a new GPU texture, or NULL on error.
415 ///
416 /// ## Availability
417 /// This function is available since SDL_image 3.4.0.
418 ///
419 /// ## See also
420 /// - [`IMG_LoadGPUTextureTyped_IO`]
421 /// - [`IMG_LoadGPUTexture_IO`]
422 pub fn IMG_LoadGPUTexture(
423 device: *mut SDL_GPUDevice,
424 copy_pass: *mut SDL_GPUCopyPass,
425 file: *const ::core::ffi::c_char,
426 width: *mut ::core::ffi::c_int,
427 height: *mut ::core::ffi::c_int,
428 ) -> *mut SDL_GPUTexture;
429}
430
431unsafe extern "C" {
432 /// Load an image from an SDL data source into a GPU texture.
433 ///
434 /// An [`SDL_GPUTexture`] represents an image in GPU memory, usable by SDL's GPU
435 /// API. Regardless of the source format of the image, this function will
436 /// create a GPU texture with the format [`SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM`]
437 /// with no mip levels. It can be bound as a sampled texture from a graphics or
438 /// compute pipeline and as a a readonly storage texture in a compute pipeline.
439 ///
440 /// If `closeio` is true, `src` will be closed before returning, whether this
441 /// function succeeds or not. SDL_image reads everything it needs from `src`
442 /// during this call in any case.
443 ///
444 /// There is a separate function to read files from disk without having to deal
445 /// with [`SDL_IOStream`]\: `IMG_LoadGPUTexture(device, copy_pass, "filename.jpg",
446 /// width, height) will call this function and manage those details for you,
447 /// determining the file type from the filename's extension.
448 ///
449 /// There is also [`IMG_LoadGPUTextureTyped_IO()`], which is equivalent to this
450 /// function except a file extension (like "BMP", "JPG", etc) can be specified,
451 /// in case SDL_image cannot autodetect the file format.
452 ///
453 /// When done with the returned texture, the app should dispose of it with a
454 /// call to [`SDL_ReleaseGPUTexture()`].
455 ///
456 /// ## Parameters
457 /// - `device`: the [`SDL_GPUDevice`] to use to create the GPU texture.
458 /// - `copy_pass`: the [`SDL_GPUCopyPass`] to use to upload the loaded image to
459 /// the GPU texture.
460 /// - `src`: an [`SDL_IOStream`] that data will be read from.
461 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
462 /// to leave it open.
463 /// - `width`: a pointer filled in with the width of the GPU texture. may be
464 /// NULL.
465 /// - `height`: a pointer filled in with the width of the GPU texture. may be
466 /// NULL.
467 ///
468 /// ## Return value
469 /// Returns a new GPU texture, or NULL on error.
470 ///
471 /// ## Availability
472 /// This function is available since SDL_image 3.4.0.
473 ///
474 /// ## See also
475 /// - [`IMG_LoadGPUTexture`]
476 /// - [`IMG_LoadGPUTextureTyped_IO`]
477 pub fn IMG_LoadGPUTexture_IO(
478 device: *mut SDL_GPUDevice,
479 copy_pass: *mut SDL_GPUCopyPass,
480 src: *mut SDL_IOStream,
481 closeio: ::core::primitive::bool,
482 width: *mut ::core::ffi::c_int,
483 height: *mut ::core::ffi::c_int,
484 ) -> *mut SDL_GPUTexture;
485}
486
487unsafe extern "C" {
488 /// Load an image from an SDL data source into a GPU texture.
489 ///
490 /// An [`SDL_GPUTexture`] represents an image in GPU memory, usable by SDL's GPU
491 /// API. Regardless of the source format of the image, this function will
492 /// create a GPU texture with the format [`SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM`]
493 /// with no mip levels. It can be bound as a sampled texture from a graphics or
494 /// compute pipeline and as a a readonly storage texture in a compute pipeline.
495 ///
496 /// If `closeio` is true, `src` will be closed before returning, whether this
497 /// function succeeds or not. SDL_image reads everything it needs from `src`
498 /// during this call in any case.
499 ///
500 /// Even though this function accepts a file type, SDL_image may still try
501 /// other decoders that are capable of detecting file type from the contents of
502 /// the image data, but may rely on the caller-provided type string for formats
503 /// that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
504 /// its ability to guess the format.
505 ///
506 /// There is a separate function to read files from disk without having to deal
507 /// with [`SDL_IOStream`]\: `IMG_LoadGPUTexture(device, copy_pass, "filename.jpg",
508 /// width, height) will call this function and manage those details for you,
509 /// determining the file type from the filename's extension.
510 ///
511 /// There is also [`IMG_LoadGPUTexture_IO()`], which is equivalent to this function
512 /// except that it will rely on SDL_image to determine what type of data it is
513 /// loading, much like passing a NULL for type.
514 ///
515 /// When done with the returned texture, the app should dispose of it with a
516 /// call to [`SDL_ReleaseGPUTexture()`].
517 ///
518 /// ## Parameters
519 /// - `device`: the [`SDL_GPUDevice`] to use to create the GPU texture.
520 /// - `copy_pass`: the [`SDL_GPUCopyPass`] to use to upload the loaded image to
521 /// the GPU texture.
522 /// - `src`: an [`SDL_IOStream`] that data will be read from.
523 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
524 /// to leave it open.
525 /// - `type`: a filename extension that represent this data ("BMP", "GIF",
526 /// "PNG", etc).
527 /// - `width`: a pointer filled in with the width of the GPU texture. may be
528 /// NULL.
529 /// - `height`: a pointer filled in with the width of the GPU texture. may be
530 /// NULL.
531 ///
532 /// ## Return value
533 /// Returns a new GPU texture, or NULL on error.
534 ///
535 /// ## Availability
536 /// This function is available since SDL_image 3.4.0.
537 ///
538 /// ## See also
539 /// - [`IMG_LoadGPUTexture`]
540 /// - [`IMG_LoadGPUTexture_IO`]
541 pub fn IMG_LoadGPUTextureTyped_IO(
542 device: *mut SDL_GPUDevice,
543 copy_pass: *mut SDL_GPUCopyPass,
544 src: *mut SDL_IOStream,
545 closeio: ::core::primitive::bool,
546 r#type: *const ::core::ffi::c_char,
547 width: *mut ::core::ffi::c_int,
548 height: *mut ::core::ffi::c_int,
549 ) -> *mut SDL_GPUTexture;
550}
551
552unsafe extern "C" {
553 /// Get the image currently in the clipboard.
554 ///
555 /// When done with the returned surface, the app should dispose of it with a
556 /// call to [`SDL_DestroySurface()`].
557 ///
558 /// ## Return value
559 /// Returns a new SDL surface, or NULL if no supported image is available.
560 ///
561 /// ## Availability
562 /// This function is available since SDL_image 3.4.0.
563 pub fn IMG_GetClipboardImage() -> *mut SDL_Surface;
564}
565
566unsafe extern "C" {
567 /// Detect ANI animated cursor data on a readable/seekable [`SDL_IOStream`].
568 ///
569 /// This function attempts to determine if a file is a given filetype, reading
570 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
571 ///
572 /// There is no distinction made between "not the filetype in question" and
573 /// basic i/o errors.
574 ///
575 /// This function will always attempt to seek `src` back to where it started
576 /// when this function was called, but it will not report any errors in doing
577 /// so, but assuming seeking works, this means you can immediately use this
578 /// with a different IMG_isTYPE function, or load the image without further
579 /// seeking.
580 ///
581 /// You do not need to call this function to load data; SDL_image can work to
582 /// determine file type in many cases in its standard load functions.
583 ///
584 /// ## Parameters
585 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
586 ///
587 /// ## Return value
588 /// Returns true if this is ANI animated cursor data, false otherwise.
589 ///
590 /// ## Availability
591 /// This function is available since SDL_image 3.0.0.
592 ///
593 /// ## See also
594 /// - [`IMG_isAVIF`]
595 /// - [`IMG_isBMP`]
596 /// - [`IMG_isCUR`]
597 /// - [`IMG_isGIF`]
598 /// - [`IMG_isICO`]
599 /// - [`IMG_isJPG`]
600 /// - [`IMG_isJXL`]
601 /// - [`IMG_isLBM`]
602 /// - [`IMG_isPCX`]
603 /// - [`IMG_isPNG`]
604 /// - [`IMG_isPNM`]
605 /// - [`IMG_isQOI`]
606 /// - [`IMG_isSVG`]
607 /// - [`IMG_isTIF`]
608 /// - [`IMG_isWEBP`]
609 /// - [`IMG_isXCF`]
610 /// - [`IMG_isXPM`]
611 /// - [`IMG_isXV`]
612 pub fn IMG_isANI(src: *mut SDL_IOStream) -> ::core::primitive::bool;
613}
614
615unsafe extern "C" {
616 /// Detect AVIF image data on a readable/seekable [`SDL_IOStream`].
617 ///
618 /// This function attempts to determine if a file is a given filetype, reading
619 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
620 ///
621 /// There is no distinction made between "not the filetype in question" and
622 /// basic i/o errors.
623 ///
624 /// This function will always attempt to seek `src` back to where it started
625 /// when this function was called, but it will not report any errors in doing
626 /// so, but assuming seeking works, this means you can immediately use this
627 /// with a different IMG_isTYPE function, or load the image without further
628 /// seeking.
629 ///
630 /// You do not need to call this function to load data; SDL_image can work to
631 /// determine file type in many cases in its standard load functions.
632 ///
633 /// ## Parameters
634 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
635 ///
636 /// ## Return value
637 /// Returns true if this is AVIF data, false otherwise.
638 ///
639 /// ## Availability
640 /// This function is available since SDL_image 3.0.0.
641 ///
642 /// ## See also
643 /// - [`IMG_isANI`]
644 /// - [`IMG_isBMP`]
645 /// - [`IMG_isCUR`]
646 /// - [`IMG_isGIF`]
647 /// - [`IMG_isICO`]
648 /// - [`IMG_isJPG`]
649 /// - [`IMG_isJXL`]
650 /// - [`IMG_isLBM`]
651 /// - [`IMG_isPCX`]
652 /// - [`IMG_isPNG`]
653 /// - [`IMG_isPNM`]
654 /// - [`IMG_isQOI`]
655 /// - [`IMG_isSVG`]
656 /// - [`IMG_isTIF`]
657 /// - [`IMG_isWEBP`]
658 /// - [`IMG_isXCF`]
659 /// - [`IMG_isXPM`]
660 /// - [`IMG_isXV`]
661 pub fn IMG_isAVIF(src: *mut SDL_IOStream) -> ::core::primitive::bool;
662}
663
664unsafe extern "C" {
665 /// Detect CUR image data on a readable/seekable [`SDL_IOStream`].
666 ///
667 /// This function attempts to determine if a file is a given filetype, reading
668 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
669 ///
670 /// There is no distinction made between "not the filetype in question" and
671 /// basic i/o errors.
672 ///
673 /// This function will always attempt to seek `src` back to where it started
674 /// when this function was called, but it will not report any errors in doing
675 /// so, but assuming seeking works, this means you can immediately use this
676 /// with a different IMG_isTYPE function, or load the image without further
677 /// seeking.
678 ///
679 /// You do not need to call this function to load data; SDL_image can work to
680 /// determine file type in many cases in its standard load functions.
681 ///
682 /// ## Parameters
683 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
684 ///
685 /// ## Return value
686 /// Returns true if this is CUR data, false otherwise.
687 ///
688 /// ## Availability
689 /// This function is available since SDL_image 3.0.0.
690 ///
691 /// ## See also
692 /// - [`IMG_isANI`]
693 /// - [`IMG_isAVIF`]
694 /// - [`IMG_isBMP`]
695 /// - [`IMG_isGIF`]
696 /// - [`IMG_isICO`]
697 /// - [`IMG_isJPG`]
698 /// - [`IMG_isJXL`]
699 /// - [`IMG_isLBM`]
700 /// - [`IMG_isPCX`]
701 /// - [`IMG_isPNG`]
702 /// - [`IMG_isPNM`]
703 /// - [`IMG_isQOI`]
704 /// - [`IMG_isSVG`]
705 /// - [`IMG_isTIF`]
706 /// - [`IMG_isWEBP`]
707 /// - [`IMG_isXCF`]
708 /// - [`IMG_isXPM`]
709 /// - [`IMG_isXV`]
710 pub fn IMG_isCUR(src: *mut SDL_IOStream) -> ::core::primitive::bool;
711}
712
713unsafe extern "C" {
714 /// Detect BMP image data on a readable/seekable [`SDL_IOStream`].
715 ///
716 /// This function attempts to determine if a file is a given filetype, reading
717 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
718 ///
719 /// There is no distinction made between "not the filetype in question" and
720 /// basic i/o errors.
721 ///
722 /// This function will always attempt to seek `src` back to where it started
723 /// when this function was called, but it will not report any errors in doing
724 /// so, but assuming seeking works, this means you can immediately use this
725 /// with a different IMG_isTYPE function, or load the image without further
726 /// seeking.
727 ///
728 /// You do not need to call this function to load data; SDL_image can work to
729 /// determine file type in many cases in its standard load functions.
730 ///
731 /// ## Parameters
732 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
733 ///
734 /// ## Return value
735 /// Returns true if this is BMP data, false otherwise.
736 ///
737 /// ## Availability
738 /// This function is available since SDL_image 3.0.0.
739 ///
740 /// ## See also
741 /// - [`IMG_isANI`]
742 /// - [`IMG_isAVIF`]
743 /// - [`IMG_isCUR`]
744 /// - [`IMG_isGIF`]
745 /// - [`IMG_isICO`]
746 /// - [`IMG_isJPG`]
747 /// - [`IMG_isJXL`]
748 /// - [`IMG_isLBM`]
749 /// - [`IMG_isPCX`]
750 /// - [`IMG_isPNG`]
751 /// - [`IMG_isPNM`]
752 /// - [`IMG_isQOI`]
753 /// - [`IMG_isSVG`]
754 /// - [`IMG_isTIF`]
755 /// - [`IMG_isWEBP`]
756 /// - [`IMG_isXCF`]
757 /// - [`IMG_isXPM`]
758 /// - [`IMG_isXV`]
759 pub fn IMG_isBMP(src: *mut SDL_IOStream) -> ::core::primitive::bool;
760}
761
762unsafe extern "C" {
763 /// Detect GIF image data on a readable/seekable [`SDL_IOStream`].
764 ///
765 /// This function attempts to determine if a file is a given filetype, reading
766 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
767 ///
768 /// There is no distinction made between "not the filetype in question" and
769 /// basic i/o errors.
770 ///
771 /// This function will always attempt to seek `src` back to where it started
772 /// when this function was called, but it will not report any errors in doing
773 /// so, but assuming seeking works, this means you can immediately use this
774 /// with a different IMG_isTYPE function, or load the image without further
775 /// seeking.
776 ///
777 /// You do not need to call this function to load data; SDL_image can work to
778 /// determine file type in many cases in its standard load functions.
779 ///
780 /// ## Parameters
781 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
782 ///
783 /// ## Return value
784 /// Returns true if this is GIF data, false otherwise.
785 ///
786 /// ## Availability
787 /// This function is available since SDL_image 3.0.0.
788 ///
789 /// ## See also
790 /// - [`IMG_isANI`]
791 /// - [`IMG_isAVIF`]
792 /// - [`IMG_isBMP`]
793 /// - [`IMG_isCUR`]
794 /// - [`IMG_isICO`]
795 /// - [`IMG_isJPG`]
796 /// - [`IMG_isJXL`]
797 /// - [`IMG_isLBM`]
798 /// - [`IMG_isPCX`]
799 /// - [`IMG_isPNG`]
800 /// - [`IMG_isPNM`]
801 /// - [`IMG_isQOI`]
802 /// - [`IMG_isSVG`]
803 /// - [`IMG_isTIF`]
804 /// - [`IMG_isWEBP`]
805 /// - [`IMG_isXCF`]
806 /// - [`IMG_isXPM`]
807 /// - [`IMG_isXV`]
808 pub fn IMG_isGIF(src: *mut SDL_IOStream) -> ::core::primitive::bool;
809}
810
811unsafe extern "C" {
812 /// Detect ICO image data on a readable/seekable [`SDL_IOStream`].
813 ///
814 /// This function attempts to determine if a file is a given filetype, reading
815 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
816 ///
817 /// There is no distinction made between "not the filetype in question" and
818 /// basic i/o errors.
819 ///
820 /// This function will always attempt to seek `src` back to where it started
821 /// when this function was called, but it will not report any errors in doing
822 /// so, but assuming seeking works, this means you can immediately use this
823 /// with a different IMG_isTYPE function, or load the image without further
824 /// seeking.
825 ///
826 /// You do not need to call this function to load data; SDL_image can work to
827 /// determine file type in many cases in its standard load functions.
828 ///
829 /// ## Parameters
830 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
831 ///
832 /// ## Return value
833 /// Returns true if this is ICO data, false otherwise.
834 ///
835 /// ## Availability
836 /// This function is available since SDL_image 3.0.0.
837 ///
838 /// ## See also
839 /// - [`IMG_isANI`]
840 /// - [`IMG_isAVIF`]
841 /// - [`IMG_isBMP`]
842 /// - [`IMG_isCUR`]
843 /// - [`IMG_isGIF`]
844 /// - [`IMG_isJPG`]
845 /// - [`IMG_isJXL`]
846 /// - [`IMG_isLBM`]
847 /// - [`IMG_isPCX`]
848 /// - [`IMG_isPNG`]
849 /// - [`IMG_isPNM`]
850 /// - [`IMG_isQOI`]
851 /// - [`IMG_isSVG`]
852 /// - [`IMG_isTIF`]
853 /// - [`IMG_isWEBP`]
854 /// - [`IMG_isXCF`]
855 /// - [`IMG_isXPM`]
856 /// - [`IMG_isXV`]
857 pub fn IMG_isICO(src: *mut SDL_IOStream) -> ::core::primitive::bool;
858}
859
860unsafe extern "C" {
861 /// Detect JPG image data on a readable/seekable [`SDL_IOStream`].
862 ///
863 /// This function attempts to determine if a file is a given filetype, reading
864 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
865 ///
866 /// There is no distinction made between "not the filetype in question" and
867 /// basic i/o errors.
868 ///
869 /// This function will always attempt to seek `src` back to where it started
870 /// when this function was called, but it will not report any errors in doing
871 /// so, but assuming seeking works, this means you can immediately use this
872 /// with a different IMG_isTYPE function, or load the image without further
873 /// seeking.
874 ///
875 /// You do not need to call this function to load data; SDL_image can work to
876 /// determine file type in many cases in its standard load functions.
877 ///
878 /// ## Parameters
879 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
880 ///
881 /// ## Return value
882 /// Returns true if this is JPG data, false otherwise.
883 ///
884 /// ## Availability
885 /// This function is available since SDL_image 3.0.0.
886 ///
887 /// ## See also
888 /// - [`IMG_isANI`]
889 /// - [`IMG_isAVIF`]
890 /// - [`IMG_isBMP`]
891 /// - [`IMG_isCUR`]
892 /// - [`IMG_isGIF`]
893 /// - [`IMG_isICO`]
894 /// - [`IMG_isJXL`]
895 /// - [`IMG_isLBM`]
896 /// - [`IMG_isPCX`]
897 /// - [`IMG_isPNG`]
898 /// - [`IMG_isPNM`]
899 /// - [`IMG_isQOI`]
900 /// - [`IMG_isSVG`]
901 /// - [`IMG_isTIF`]
902 /// - [`IMG_isWEBP`]
903 /// - [`IMG_isXCF`]
904 /// - [`IMG_isXPM`]
905 /// - [`IMG_isXV`]
906 pub fn IMG_isJPG(src: *mut SDL_IOStream) -> ::core::primitive::bool;
907}
908
909unsafe extern "C" {
910 /// Detect JXL image data on a readable/seekable [`SDL_IOStream`].
911 ///
912 /// This function attempts to determine if a file is a given filetype, reading
913 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
914 ///
915 /// There is no distinction made between "not the filetype in question" and
916 /// basic i/o errors.
917 ///
918 /// This function will always attempt to seek `src` back to where it started
919 /// when this function was called, but it will not report any errors in doing
920 /// so, but assuming seeking works, this means you can immediately use this
921 /// with a different IMG_isTYPE function, or load the image without further
922 /// seeking.
923 ///
924 /// You do not need to call this function to load data; SDL_image can work to
925 /// determine file type in many cases in its standard load functions.
926 ///
927 /// ## Parameters
928 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
929 ///
930 /// ## Return value
931 /// Returns true if this is JXL data, false otherwise.
932 ///
933 /// ## Availability
934 /// This function is available since SDL_image 3.0.0.
935 ///
936 /// ## See also
937 /// - [`IMG_isANI`]
938 /// - [`IMG_isAVIF`]
939 /// - [`IMG_isBMP`]
940 /// - [`IMG_isCUR`]
941 /// - [`IMG_isGIF`]
942 /// - [`IMG_isICO`]
943 /// - [`IMG_isJPG`]
944 /// - [`IMG_isLBM`]
945 /// - [`IMG_isPCX`]
946 /// - [`IMG_isPNG`]
947 /// - [`IMG_isPNM`]
948 /// - [`IMG_isQOI`]
949 /// - [`IMG_isSVG`]
950 /// - [`IMG_isTIF`]
951 /// - [`IMG_isWEBP`]
952 /// - [`IMG_isXCF`]
953 /// - [`IMG_isXPM`]
954 /// - [`IMG_isXV`]
955 pub fn IMG_isJXL(src: *mut SDL_IOStream) -> ::core::primitive::bool;
956}
957
958unsafe extern "C" {
959 /// Detect LBM image data on a readable/seekable [`SDL_IOStream`].
960 ///
961 /// This function attempts to determine if a file is a given filetype, reading
962 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
963 ///
964 /// There is no distinction made between "not the filetype in question" and
965 /// basic i/o errors.
966 ///
967 /// This function will always attempt to seek `src` back to where it started
968 /// when this function was called, but it will not report any errors in doing
969 /// so, but assuming seeking works, this means you can immediately use this
970 /// with a different IMG_isTYPE function, or load the image without further
971 /// seeking.
972 ///
973 /// You do not need to call this function to load data; SDL_image can work to
974 /// determine file type in many cases in its standard load functions.
975 ///
976 /// ## Parameters
977 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
978 ///
979 /// ## Return value
980 /// Returns true if this is LBM data, false otherwise.
981 ///
982 /// ## Availability
983 /// This function is available since SDL_image 3.0.0.
984 ///
985 /// ## See also
986 /// - [`IMG_isANI`]
987 /// - [`IMG_isAVIF`]
988 /// - [`IMG_isBMP`]
989 /// - [`IMG_isCUR`]
990 /// - [`IMG_isGIF`]
991 /// - [`IMG_isICO`]
992 /// - [`IMG_isJPG`]
993 /// - [`IMG_isJXL`]
994 /// - [`IMG_isPCX`]
995 /// - [`IMG_isPNG`]
996 /// - [`IMG_isPNM`]
997 /// - [`IMG_isQOI`]
998 /// - [`IMG_isSVG`]
999 /// - [`IMG_isTIF`]
1000 /// - [`IMG_isWEBP`]
1001 /// - [`IMG_isXCF`]
1002 /// - [`IMG_isXPM`]
1003 /// - [`IMG_isXV`]
1004 pub fn IMG_isLBM(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1005}
1006
1007unsafe extern "C" {
1008 /// Detect PCX image data on a readable/seekable [`SDL_IOStream`].
1009 ///
1010 /// This function attempts to determine if a file is a given filetype, reading
1011 /// the least amount possible from the [`SDL_IOStream`] (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 `src` back to where it started
1017 /// when this function was called, but it will not report any errors in doing
1018 /// so, but assuming seeking works, this means you can immediately use this
1019 /// with a different IMG_isTYPE function, or load the image without further
1020 /// 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 /// ## Parameters
1026 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1027 ///
1028 /// ## Return value
1029 /// Returns true if this is PCX data, false otherwise.
1030 ///
1031 /// ## Availability
1032 /// This function is available since SDL_image 3.0.0.
1033 ///
1034 /// ## See also
1035 /// - [`IMG_isANI`]
1036 /// - [`IMG_isAVIF`]
1037 /// - [`IMG_isBMP`]
1038 /// - [`IMG_isCUR`]
1039 /// - [`IMG_isGIF`]
1040 /// - [`IMG_isICO`]
1041 /// - [`IMG_isJPG`]
1042 /// - [`IMG_isJXL`]
1043 /// - [`IMG_isLBM`]
1044 /// - [`IMG_isPNG`]
1045 /// - [`IMG_isPNM`]
1046 /// - [`IMG_isQOI`]
1047 /// - [`IMG_isSVG`]
1048 /// - [`IMG_isTIF`]
1049 /// - [`IMG_isWEBP`]
1050 /// - [`IMG_isXCF`]
1051 /// - [`IMG_isXPM`]
1052 /// - [`IMG_isXV`]
1053 pub fn IMG_isPCX(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1054}
1055
1056unsafe extern "C" {
1057 /// Detect PNG image data on a readable/seekable [`SDL_IOStream`].
1058 ///
1059 /// This function attempts to determine if a file is a given filetype, reading
1060 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1061 ///
1062 /// There is no distinction made between "not the filetype in question" and
1063 /// basic i/o errors.
1064 ///
1065 /// This function will always attempt to seek `src` back to where it started
1066 /// when this function was called, but it will not report any errors in doing
1067 /// so, but assuming seeking works, this means you can immediately use this
1068 /// with a different IMG_isTYPE function, or load the image without further
1069 /// seeking.
1070 ///
1071 /// You do not need to call this function to load data; SDL_image can work to
1072 /// determine file type in many cases in its standard load functions.
1073 ///
1074 /// ## Parameters
1075 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1076 ///
1077 /// ## Return value
1078 /// Returns true if this is PNG data, false otherwise.
1079 ///
1080 /// ## Availability
1081 /// This function is available since SDL_image 3.0.0.
1082 ///
1083 /// ## See also
1084 /// - [`IMG_isANI`]
1085 /// - [`IMG_isAVIF`]
1086 /// - [`IMG_isBMP`]
1087 /// - [`IMG_isCUR`]
1088 /// - [`IMG_isGIF`]
1089 /// - [`IMG_isICO`]
1090 /// - [`IMG_isJPG`]
1091 /// - [`IMG_isJXL`]
1092 /// - [`IMG_isLBM`]
1093 /// - [`IMG_isPCX`]
1094 /// - [`IMG_isPNM`]
1095 /// - [`IMG_isQOI`]
1096 /// - [`IMG_isSVG`]
1097 /// - [`IMG_isTIF`]
1098 /// - [`IMG_isWEBP`]
1099 /// - [`IMG_isXCF`]
1100 /// - [`IMG_isXPM`]
1101 /// - [`IMG_isXV`]
1102 pub fn IMG_isPNG(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1103}
1104
1105unsafe extern "C" {
1106 /// Detect PNM image data on a readable/seekable [`SDL_IOStream`].
1107 ///
1108 /// This function attempts to determine if a file is a given filetype, reading
1109 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1110 ///
1111 /// There is no distinction made between "not the filetype in question" and
1112 /// basic i/o errors.
1113 ///
1114 /// This function will always attempt to seek `src` back to where it started
1115 /// when this function was called, but it will not report any errors in doing
1116 /// so, but assuming seeking works, this means you can immediately use this
1117 /// with a different IMG_isTYPE function, or load the image without further
1118 /// seeking.
1119 ///
1120 /// You do not need to call this function to load data; SDL_image can work to
1121 /// determine file type in many cases in its standard load functions.
1122 ///
1123 /// ## Parameters
1124 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1125 ///
1126 /// ## Return value
1127 /// Returns true if this is PNM data, false otherwise.
1128 ///
1129 /// ## Availability
1130 /// This function is available since SDL_image 3.0.0.
1131 ///
1132 /// ## See also
1133 /// - [`IMG_isANI`]
1134 /// - [`IMG_isAVIF`]
1135 /// - [`IMG_isBMP`]
1136 /// - [`IMG_isCUR`]
1137 /// - [`IMG_isGIF`]
1138 /// - [`IMG_isICO`]
1139 /// - [`IMG_isJPG`]
1140 /// - [`IMG_isJXL`]
1141 /// - [`IMG_isLBM`]
1142 /// - [`IMG_isPCX`]
1143 /// - [`IMG_isPNG`]
1144 /// - [`IMG_isQOI`]
1145 /// - [`IMG_isSVG`]
1146 /// - [`IMG_isTIF`]
1147 /// - [`IMG_isWEBP`]
1148 /// - [`IMG_isXCF`]
1149 /// - [`IMG_isXPM`]
1150 /// - [`IMG_isXV`]
1151 pub fn IMG_isPNM(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1152}
1153
1154unsafe extern "C" {
1155 /// Detect QOI image data on a readable/seekable [`SDL_IOStream`].
1156 ///
1157 /// This function attempts to determine if a file is a given filetype, reading
1158 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1159 ///
1160 /// There is no distinction made between "not the filetype in question" and
1161 /// basic i/o errors.
1162 ///
1163 /// This function will always attempt to seek `src` back to where it started
1164 /// when this function was called, but it will not report any errors in doing
1165 /// so, but assuming seeking works, this means you can immediately use this
1166 /// with a different IMG_isTYPE function, or load the image without further
1167 /// seeking.
1168 ///
1169 /// You do not need to call this function to load data; SDL_image can work to
1170 /// determine file type in many cases in its standard load functions.
1171 ///
1172 /// ## Parameters
1173 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1174 ///
1175 /// ## Return value
1176 /// Returns true if this is QOI data, false otherwise.
1177 ///
1178 /// ## Availability
1179 /// This function is available since SDL_image 3.0.0.
1180 ///
1181 /// ## See also
1182 /// - [`IMG_isANI`]
1183 /// - [`IMG_isAVIF`]
1184 /// - [`IMG_isBMP`]
1185 /// - [`IMG_isCUR`]
1186 /// - [`IMG_isGIF`]
1187 /// - [`IMG_isICO`]
1188 /// - [`IMG_isJPG`]
1189 /// - [`IMG_isJXL`]
1190 /// - [`IMG_isLBM`]
1191 /// - [`IMG_isPCX`]
1192 /// - [`IMG_isPNG`]
1193 /// - [`IMG_isPNM`]
1194 /// - [`IMG_isSVG`]
1195 /// - [`IMG_isTIF`]
1196 /// - [`IMG_isWEBP`]
1197 /// - [`IMG_isXCF`]
1198 /// - [`IMG_isXPM`]
1199 /// - [`IMG_isXV`]
1200 pub fn IMG_isQOI(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1201}
1202
1203unsafe extern "C" {
1204 /// Detect SVG image data on a readable/seekable [`SDL_IOStream`].
1205 ///
1206 /// This function attempts to determine if a file is a given filetype, reading
1207 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1208 ///
1209 /// There is no distinction made between "not the filetype in question" and
1210 /// basic i/o errors.
1211 ///
1212 /// This function will always attempt to seek `src` back to where it started
1213 /// when this function was called, but it will not report any errors in doing
1214 /// so, but assuming seeking works, this means you can immediately use this
1215 /// with a different IMG_isTYPE function, or load the image without further
1216 /// seeking.
1217 ///
1218 /// You do not need to call this function to load data; SDL_image can work to
1219 /// determine file type in many cases in its standard load functions.
1220 ///
1221 /// ## Parameters
1222 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1223 ///
1224 /// ## Return value
1225 /// Returns true if this is SVG data, false otherwise.
1226 ///
1227 /// ## Availability
1228 /// This function is available since SDL_image 3.0.0.
1229 ///
1230 /// ## See also
1231 /// - [`IMG_isANI`]
1232 /// - [`IMG_isAVIF`]
1233 /// - [`IMG_isBMP`]
1234 /// - [`IMG_isCUR`]
1235 /// - [`IMG_isGIF`]
1236 /// - [`IMG_isICO`]
1237 /// - [`IMG_isJPG`]
1238 /// - [`IMG_isJXL`]
1239 /// - [`IMG_isLBM`]
1240 /// - [`IMG_isPCX`]
1241 /// - [`IMG_isPNG`]
1242 /// - [`IMG_isPNM`]
1243 /// - [`IMG_isQOI`]
1244 /// - [`IMG_isTIF`]
1245 /// - [`IMG_isWEBP`]
1246 /// - [`IMG_isXCF`]
1247 /// - [`IMG_isXPM`]
1248 /// - [`IMG_isXV`]
1249 pub fn IMG_isSVG(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1250}
1251
1252unsafe extern "C" {
1253 /// Detect TIFF image data on a readable/seekable [`SDL_IOStream`].
1254 ///
1255 /// This function attempts to determine if a file is a given filetype, reading
1256 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1257 ///
1258 /// There is no distinction made between "not the filetype in question" and
1259 /// basic i/o errors.
1260 ///
1261 /// This function will always attempt to seek `src` back to where it started
1262 /// when this function was called, but it will not report any errors in doing
1263 /// so, but assuming seeking works, this means you can immediately use this
1264 /// with a different IMG_isTYPE function, or load the image without further
1265 /// seeking.
1266 ///
1267 /// You do not need to call this function to load data; SDL_image can work to
1268 /// determine file type in many cases in its standard load functions.
1269 ///
1270 /// ## Parameters
1271 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1272 ///
1273 /// ## Return value
1274 /// Returns true if this is TIFF data, false otherwise.
1275 ///
1276 /// ## Availability
1277 /// This function is available since SDL_image 3.0.0.
1278 ///
1279 /// ## See also
1280 /// - [`IMG_isANI`]
1281 /// - [`IMG_isAVIF`]
1282 /// - [`IMG_isBMP`]
1283 /// - [`IMG_isCUR`]
1284 /// - [`IMG_isGIF`]
1285 /// - [`IMG_isICO`]
1286 /// - [`IMG_isJPG`]
1287 /// - [`IMG_isJXL`]
1288 /// - [`IMG_isLBM`]
1289 /// - [`IMG_isPCX`]
1290 /// - [`IMG_isPNG`]
1291 /// - [`IMG_isPNM`]
1292 /// - [`IMG_isQOI`]
1293 /// - [`IMG_isSVG`]
1294 /// - [`IMG_isWEBP`]
1295 /// - [`IMG_isXCF`]
1296 /// - [`IMG_isXPM`]
1297 /// - [`IMG_isXV`]
1298 pub fn IMG_isTIF(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1299}
1300
1301unsafe extern "C" {
1302 /// Detect WEBP image data on a readable/seekable [`SDL_IOStream`].
1303 ///
1304 /// This function attempts to determine if a file is a given filetype, reading
1305 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1306 ///
1307 /// There is no distinction made between "not the filetype in question" and
1308 /// basic i/o errors.
1309 ///
1310 /// This function will always attempt to seek `src` back to where it started
1311 /// when this function was called, but it will not report any errors in doing
1312 /// so, but assuming seeking works, this means you can immediately use this
1313 /// with a different IMG_isTYPE function, or load the image without further
1314 /// seeking.
1315 ///
1316 /// You do not need to call this function to load data; SDL_image can work to
1317 /// determine file type in many cases in its standard load functions.
1318 ///
1319 /// ## Parameters
1320 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1321 ///
1322 /// ## Return value
1323 /// Returns true if this is WEBP data, false otherwise.
1324 ///
1325 /// ## Availability
1326 /// This function is available since SDL_image 3.0.0.
1327 ///
1328 /// ## See also
1329 /// - [`IMG_isANI`]
1330 /// - [`IMG_isAVIF`]
1331 /// - [`IMG_isBMP`]
1332 /// - [`IMG_isCUR`]
1333 /// - [`IMG_isGIF`]
1334 /// - [`IMG_isICO`]
1335 /// - [`IMG_isJPG`]
1336 /// - [`IMG_isJXL`]
1337 /// - [`IMG_isLBM`]
1338 /// - [`IMG_isPCX`]
1339 /// - [`IMG_isPNG`]
1340 /// - [`IMG_isPNM`]
1341 /// - [`IMG_isQOI`]
1342 /// - [`IMG_isSVG`]
1343 /// - [`IMG_isTIF`]
1344 /// - [`IMG_isXCF`]
1345 /// - [`IMG_isXPM`]
1346 /// - [`IMG_isXV`]
1347 pub fn IMG_isWEBP(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1348}
1349
1350unsafe extern "C" {
1351 /// Detect XCF image data on a readable/seekable [`SDL_IOStream`].
1352 ///
1353 /// This function attempts to determine if a file is a given filetype, reading
1354 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1355 ///
1356 /// There is no distinction made between "not the filetype in question" and
1357 /// basic i/o errors.
1358 ///
1359 /// This function will always attempt to seek `src` back to where it started
1360 /// when this function was called, but it will not report any errors in doing
1361 /// so, but assuming seeking works, this means you can immediately use this
1362 /// with a different IMG_isTYPE function, or load the image without further
1363 /// seeking.
1364 ///
1365 /// You do not need to call this function to load data; SDL_image can work to
1366 /// determine file type in many cases in its standard load functions.
1367 ///
1368 /// ## Parameters
1369 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1370 ///
1371 /// ## Return value
1372 /// Returns true if this is XCF data, false otherwise.
1373 ///
1374 /// ## Availability
1375 /// This function is available since SDL_image 3.0.0.
1376 ///
1377 /// ## See also
1378 /// - [`IMG_isANI`]
1379 /// - [`IMG_isAVIF`]
1380 /// - [`IMG_isBMP`]
1381 /// - [`IMG_isCUR`]
1382 /// - [`IMG_isGIF`]
1383 /// - [`IMG_isICO`]
1384 /// - [`IMG_isJPG`]
1385 /// - [`IMG_isJXL`]
1386 /// - [`IMG_isLBM`]
1387 /// - [`IMG_isPCX`]
1388 /// - [`IMG_isPNG`]
1389 /// - [`IMG_isPNM`]
1390 /// - [`IMG_isQOI`]
1391 /// - [`IMG_isSVG`]
1392 /// - [`IMG_isTIF`]
1393 /// - [`IMG_isWEBP`]
1394 /// - [`IMG_isXPM`]
1395 /// - [`IMG_isXV`]
1396 pub fn IMG_isXCF(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1397}
1398
1399unsafe extern "C" {
1400 /// Detect XPM image data on a readable/seekable [`SDL_IOStream`].
1401 ///
1402 /// This function attempts to determine if a file is a given filetype, reading
1403 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1404 ///
1405 /// There is no distinction made between "not the filetype in question" and
1406 /// basic i/o errors.
1407 ///
1408 /// This function will always attempt to seek `src` back to where it started
1409 /// when this function was called, but it will not report any errors in doing
1410 /// so, but assuming seeking works, this means you can immediately use this
1411 /// with a different IMG_isTYPE function, or load the image without further
1412 /// seeking.
1413 ///
1414 /// You do not need to call this function to load data; SDL_image can work to
1415 /// determine file type in many cases in its standard load functions.
1416 ///
1417 /// ## Parameters
1418 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1419 ///
1420 /// ## Return value
1421 /// Returns true if this is XPM data, false otherwise.
1422 ///
1423 /// ## Availability
1424 /// This function is available since SDL_image 3.0.0.
1425 ///
1426 /// ## See also
1427 /// - [`IMG_isANI`]
1428 /// - [`IMG_isAVIF`]
1429 /// - [`IMG_isBMP`]
1430 /// - [`IMG_isCUR`]
1431 /// - [`IMG_isGIF`]
1432 /// - [`IMG_isICO`]
1433 /// - [`IMG_isJPG`]
1434 /// - [`IMG_isJXL`]
1435 /// - [`IMG_isLBM`]
1436 /// - [`IMG_isPCX`]
1437 /// - [`IMG_isPNG`]
1438 /// - [`IMG_isPNM`]
1439 /// - [`IMG_isQOI`]
1440 /// - [`IMG_isSVG`]
1441 /// - [`IMG_isTIF`]
1442 /// - [`IMG_isWEBP`]
1443 /// - [`IMG_isXCF`]
1444 /// - [`IMG_isXV`]
1445 pub fn IMG_isXPM(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1446}
1447
1448unsafe extern "C" {
1449 /// Detect XV image data on a readable/seekable [`SDL_IOStream`].
1450 ///
1451 /// This function attempts to determine if a file is a given filetype, reading
1452 /// the least amount possible from the [`SDL_IOStream`] (usually a few bytes).
1453 ///
1454 /// There is no distinction made between "not the filetype in question" and
1455 /// basic i/o errors.
1456 ///
1457 /// This function will always attempt to seek `src` back to where it started
1458 /// when this function was called, but it will not report any errors in doing
1459 /// so, but assuming seeking works, this means you can immediately use this
1460 /// with a different IMG_isTYPE function, or load the image without further
1461 /// seeking.
1462 ///
1463 /// You do not need to call this function to load data; SDL_image can work to
1464 /// determine file type in many cases in its standard load functions.
1465 ///
1466 /// ## Parameters
1467 /// - `src`: a seekable/readable [`SDL_IOStream`] to provide image data.
1468 ///
1469 /// ## Return value
1470 /// Returns true if this is XV data, false otherwise.
1471 ///
1472 /// ## Availability
1473 /// This function is available since SDL_image 3.0.0.
1474 ///
1475 /// ## See also
1476 /// - [`IMG_isANI`]
1477 /// - [`IMG_isAVIF`]
1478 /// - [`IMG_isBMP`]
1479 /// - [`IMG_isCUR`]
1480 /// - [`IMG_isGIF`]
1481 /// - [`IMG_isICO`]
1482 /// - [`IMG_isJPG`]
1483 /// - [`IMG_isJXL`]
1484 /// - [`IMG_isLBM`]
1485 /// - [`IMG_isPCX`]
1486 /// - [`IMG_isPNG`]
1487 /// - [`IMG_isPNM`]
1488 /// - [`IMG_isQOI`]
1489 /// - [`IMG_isSVG`]
1490 /// - [`IMG_isTIF`]
1491 /// - [`IMG_isWEBP`]
1492 /// - [`IMG_isXCF`]
1493 /// - [`IMG_isXPM`]
1494 pub fn IMG_isXV(src: *mut SDL_IOStream) -> ::core::primitive::bool;
1495}
1496
1497unsafe extern "C" {
1498 /// Load a AVIF image directly.
1499 ///
1500 /// If you know you definitely have a AVIF image, you can call this function,
1501 /// which will skip SDL_image's file format detection routines. Generally it's
1502 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1503 /// interface available here.
1504 ///
1505 /// ## Parameters
1506 /// - `src`: an [`SDL_IOStream`] to load image data from.
1507 ///
1508 /// ## Return value
1509 /// Returns SDL surface, or NULL on error.
1510 ///
1511 /// ## Availability
1512 /// This function is available since SDL_image 3.0.0.
1513 ///
1514 /// ## See also
1515 /// - [`IMG_LoadBMP_IO`]
1516 /// - [`IMG_LoadCUR_IO`]
1517 /// - [`IMG_LoadGIF_IO`]
1518 /// - [`IMG_LoadICO_IO`]
1519 /// - [`IMG_LoadJPG_IO`]
1520 /// - [`IMG_LoadJXL_IO`]
1521 /// - [`IMG_LoadLBM_IO`]
1522 /// - [`IMG_LoadPCX_IO`]
1523 /// - [`IMG_LoadPNG_IO`]
1524 /// - [`IMG_LoadPNM_IO`]
1525 /// - [`IMG_LoadQOI_IO`]
1526 /// - [`IMG_LoadSVG_IO`]
1527 /// - [`IMG_LoadTGA_IO`]
1528 /// - [`IMG_LoadTIF_IO`]
1529 /// - [`IMG_LoadWEBP_IO`]
1530 /// - [`IMG_LoadXCF_IO`]
1531 /// - [`IMG_LoadXPM_IO`]
1532 /// - [`IMG_LoadXV_IO`]
1533 pub fn IMG_LoadAVIF_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1534}
1535
1536unsafe extern "C" {
1537 /// Load a BMP image directly.
1538 ///
1539 /// If you know you definitely have a BMP image, you can call this function,
1540 /// which will skip SDL_image's file format detection routines. Generally it's
1541 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1542 /// interface available here.
1543 ///
1544 /// ## Parameters
1545 /// - `src`: an [`SDL_IOStream`] to load image data from.
1546 ///
1547 /// ## Return value
1548 /// Returns SDL surface, or NULL on error.
1549 ///
1550 /// ## Availability
1551 /// This function is available since SDL_image 3.0.0.
1552 ///
1553 /// ## See also
1554 /// - [`IMG_LoadAVIF_IO`]
1555 /// - [`IMG_LoadCUR_IO`]
1556 /// - [`IMG_LoadGIF_IO`]
1557 /// - [`IMG_LoadICO_IO`]
1558 /// - [`IMG_LoadJPG_IO`]
1559 /// - [`IMG_LoadJXL_IO`]
1560 /// - [`IMG_LoadLBM_IO`]
1561 /// - [`IMG_LoadPCX_IO`]
1562 /// - [`IMG_LoadPNG_IO`]
1563 /// - [`IMG_LoadPNM_IO`]
1564 /// - [`IMG_LoadQOI_IO`]
1565 /// - [`IMG_LoadSVG_IO`]
1566 /// - [`IMG_LoadTGA_IO`]
1567 /// - [`IMG_LoadTIF_IO`]
1568 /// - [`IMG_LoadWEBP_IO`]
1569 /// - [`IMG_LoadXCF_IO`]
1570 /// - [`IMG_LoadXPM_IO`]
1571 /// - [`IMG_LoadXV_IO`]
1572 pub fn IMG_LoadBMP_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1573}
1574
1575unsafe extern "C" {
1576 /// Load a CUR image directly.
1577 ///
1578 /// If you know you definitely have a CUR image, you can call this function,
1579 /// which will skip SDL_image's file format detection routines. Generally it's
1580 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1581 /// interface available here.
1582 ///
1583 /// ## Parameters
1584 /// - `src`: an [`SDL_IOStream`] to load image data from.
1585 ///
1586 /// ## Return value
1587 /// Returns SDL surface, or NULL on error.
1588 ///
1589 /// ## Availability
1590 /// This function is available since SDL_image 3.0.0.
1591 ///
1592 /// ## See also
1593 /// - [`IMG_LoadAVIF_IO`]
1594 /// - [`IMG_LoadBMP_IO`]
1595 /// - [`IMG_LoadGIF_IO`]
1596 /// - [`IMG_LoadICO_IO`]
1597 /// - [`IMG_LoadJPG_IO`]
1598 /// - [`IMG_LoadJXL_IO`]
1599 /// - [`IMG_LoadLBM_IO`]
1600 /// - [`IMG_LoadPCX_IO`]
1601 /// - [`IMG_LoadPNG_IO`]
1602 /// - [`IMG_LoadPNM_IO`]
1603 /// - [`IMG_LoadQOI_IO`]
1604 /// - [`IMG_LoadSVG_IO`]
1605 /// - [`IMG_LoadTGA_IO`]
1606 /// - [`IMG_LoadTIF_IO`]
1607 /// - [`IMG_LoadWEBP_IO`]
1608 /// - [`IMG_LoadXCF_IO`]
1609 /// - [`IMG_LoadXPM_IO`]
1610 /// - [`IMG_LoadXV_IO`]
1611 pub fn IMG_LoadCUR_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1612}
1613
1614unsafe extern "C" {
1615 /// Load a GIF image directly.
1616 ///
1617 /// If you know you definitely have a GIF image, you can call this function,
1618 /// which will skip SDL_image's file format detection routines. Generally it's
1619 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1620 /// interface available here.
1621 ///
1622 /// ## Parameters
1623 /// - `src`: an [`SDL_IOStream`] to load image data from.
1624 ///
1625 /// ## Return value
1626 /// Returns SDL surface, or NULL on error.
1627 ///
1628 /// ## Availability
1629 /// This function is available since SDL_image 3.0.0.
1630 ///
1631 /// ## See also
1632 /// - [`IMG_LoadAVIF_IO`]
1633 /// - [`IMG_LoadBMP_IO`]
1634 /// - [`IMG_LoadCUR_IO`]
1635 /// - [`IMG_LoadICO_IO`]
1636 /// - [`IMG_LoadJPG_IO`]
1637 /// - [`IMG_LoadJXL_IO`]
1638 /// - [`IMG_LoadLBM_IO`]
1639 /// - [`IMG_LoadPCX_IO`]
1640 /// - [`IMG_LoadPNG_IO`]
1641 /// - [`IMG_LoadPNM_IO`]
1642 /// - [`IMG_LoadQOI_IO`]
1643 /// - [`IMG_LoadSVG_IO`]
1644 /// - [`IMG_LoadTGA_IO`]
1645 /// - [`IMG_LoadTIF_IO`]
1646 /// - [`IMG_LoadWEBP_IO`]
1647 /// - [`IMG_LoadXCF_IO`]
1648 /// - [`IMG_LoadXPM_IO`]
1649 /// - [`IMG_LoadXV_IO`]
1650 pub fn IMG_LoadGIF_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1651}
1652
1653unsafe extern "C" {
1654 /// Load a ICO image directly.
1655 ///
1656 /// If you know you definitely have a ICO image, you can call this function,
1657 /// which will skip SDL_image's file format detection routines. Generally it's
1658 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1659 /// interface available here.
1660 ///
1661 /// ## Parameters
1662 /// - `src`: an [`SDL_IOStream`] to load image data from.
1663 ///
1664 /// ## Return value
1665 /// Returns SDL surface, or NULL on error.
1666 ///
1667 /// ## Availability
1668 /// This function is available since SDL_image 3.0.0.
1669 ///
1670 /// ## See also
1671 /// - [`IMG_LoadAVIF_IO`]
1672 /// - [`IMG_LoadBMP_IO`]
1673 /// - [`IMG_LoadCUR_IO`]
1674 /// - [`IMG_LoadGIF_IO`]
1675 /// - [`IMG_LoadJPG_IO`]
1676 /// - [`IMG_LoadJXL_IO`]
1677 /// - [`IMG_LoadLBM_IO`]
1678 /// - [`IMG_LoadPCX_IO`]
1679 /// - [`IMG_LoadPNG_IO`]
1680 /// - [`IMG_LoadPNM_IO`]
1681 /// - [`IMG_LoadQOI_IO`]
1682 /// - [`IMG_LoadSVG_IO`]
1683 /// - [`IMG_LoadTGA_IO`]
1684 /// - [`IMG_LoadTIF_IO`]
1685 /// - [`IMG_LoadWEBP_IO`]
1686 /// - [`IMG_LoadXCF_IO`]
1687 /// - [`IMG_LoadXPM_IO`]
1688 /// - [`IMG_LoadXV_IO`]
1689 pub fn IMG_LoadICO_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1690}
1691
1692unsafe extern "C" {
1693 /// Load a JPG image directly.
1694 ///
1695 /// If you know you definitely have a JPG image, you can call this function,
1696 /// which will skip SDL_image's file format detection routines. Generally it's
1697 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1698 /// interface available here.
1699 ///
1700 /// ## Parameters
1701 /// - `src`: an [`SDL_IOStream`] to load image data from.
1702 ///
1703 /// ## Return value
1704 /// Returns SDL surface, or NULL on error.
1705 ///
1706 /// ## Availability
1707 /// This function is available since SDL_image 3.0.0.
1708 ///
1709 /// ## See also
1710 /// - [`IMG_LoadAVIF_IO`]
1711 /// - [`IMG_LoadBMP_IO`]
1712 /// - [`IMG_LoadCUR_IO`]
1713 /// - [`IMG_LoadGIF_IO`]
1714 /// - [`IMG_LoadICO_IO`]
1715 /// - [`IMG_LoadJXL_IO`]
1716 /// - [`IMG_LoadLBM_IO`]
1717 /// - [`IMG_LoadPCX_IO`]
1718 /// - [`IMG_LoadPNG_IO`]
1719 /// - [`IMG_LoadPNM_IO`]
1720 /// - [`IMG_LoadQOI_IO`]
1721 /// - [`IMG_LoadSVG_IO`]
1722 /// - [`IMG_LoadTGA_IO`]
1723 /// - [`IMG_LoadTIF_IO`]
1724 /// - [`IMG_LoadWEBP_IO`]
1725 /// - [`IMG_LoadXCF_IO`]
1726 /// - [`IMG_LoadXPM_IO`]
1727 /// - [`IMG_LoadXV_IO`]
1728 pub fn IMG_LoadJPG_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1729}
1730
1731unsafe extern "C" {
1732 /// Load a JXL image directly.
1733 ///
1734 /// If you know you definitely have a JXL image, you can call this function,
1735 /// which will skip SDL_image's file format detection routines. Generally it's
1736 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1737 /// interface available here.
1738 ///
1739 /// ## Parameters
1740 /// - `src`: an [`SDL_IOStream`] to load image data from.
1741 ///
1742 /// ## Return value
1743 /// Returns SDL surface, or NULL on error.
1744 ///
1745 /// ## Availability
1746 /// This function is available since SDL_image 3.0.0.
1747 ///
1748 /// ## See also
1749 /// - [`IMG_LoadAVIF_IO`]
1750 /// - [`IMG_LoadBMP_IO`]
1751 /// - [`IMG_LoadCUR_IO`]
1752 /// - [`IMG_LoadGIF_IO`]
1753 /// - [`IMG_LoadICO_IO`]
1754 /// - [`IMG_LoadJPG_IO`]
1755 /// - [`IMG_LoadLBM_IO`]
1756 /// - [`IMG_LoadPCX_IO`]
1757 /// - [`IMG_LoadPNG_IO`]
1758 /// - [`IMG_LoadPNM_IO`]
1759 /// - [`IMG_LoadQOI_IO`]
1760 /// - [`IMG_LoadSVG_IO`]
1761 /// - [`IMG_LoadTGA_IO`]
1762 /// - [`IMG_LoadTIF_IO`]
1763 /// - [`IMG_LoadWEBP_IO`]
1764 /// - [`IMG_LoadXCF_IO`]
1765 /// - [`IMG_LoadXPM_IO`]
1766 /// - [`IMG_LoadXV_IO`]
1767 pub fn IMG_LoadJXL_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1768}
1769
1770unsafe extern "C" {
1771 /// Load a LBM image directly.
1772 ///
1773 /// If you know you definitely have a LBM image, you can call this function,
1774 /// which will skip SDL_image's file format detection routines. Generally it's
1775 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1776 /// interface available here.
1777 ///
1778 /// ## Parameters
1779 /// - `src`: an [`SDL_IOStream`] to load image data from.
1780 ///
1781 /// ## Return value
1782 /// Returns SDL surface, or NULL on error.
1783 ///
1784 /// ## Availability
1785 /// This function is available since SDL_image 3.0.0.
1786 ///
1787 /// ## See also
1788 /// - [`IMG_LoadAVIF_IO`]
1789 /// - [`IMG_LoadBMP_IO`]
1790 /// - [`IMG_LoadCUR_IO`]
1791 /// - [`IMG_LoadGIF_IO`]
1792 /// - [`IMG_LoadICO_IO`]
1793 /// - [`IMG_LoadJPG_IO`]
1794 /// - [`IMG_LoadJXL_IO`]
1795 /// - [`IMG_LoadPCX_IO`]
1796 /// - [`IMG_LoadPNG_IO`]
1797 /// - [`IMG_LoadPNM_IO`]
1798 /// - [`IMG_LoadQOI_IO`]
1799 /// - [`IMG_LoadSVG_IO`]
1800 /// - [`IMG_LoadTGA_IO`]
1801 /// - [`IMG_LoadTIF_IO`]
1802 /// - [`IMG_LoadWEBP_IO`]
1803 /// - [`IMG_LoadXCF_IO`]
1804 /// - [`IMG_LoadXPM_IO`]
1805 /// - [`IMG_LoadXV_IO`]
1806 pub fn IMG_LoadLBM_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1807}
1808
1809unsafe extern "C" {
1810 /// Load a PCX image directly.
1811 ///
1812 /// If you know you definitely have a PCX 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_IOStream`]
1815 /// interface available here.
1816 ///
1817 /// ## Parameters
1818 /// - `src`: an [`SDL_IOStream`] to load image data from.
1819 ///
1820 /// ## Return value
1821 /// Returns SDL surface, or NULL on error.
1822 ///
1823 /// ## Availability
1824 /// This function is available since SDL_image 3.0.0.
1825 ///
1826 /// ## See also
1827 /// - [`IMG_LoadAVIF_IO`]
1828 /// - [`IMG_LoadBMP_IO`]
1829 /// - [`IMG_LoadCUR_IO`]
1830 /// - [`IMG_LoadGIF_IO`]
1831 /// - [`IMG_LoadICO_IO`]
1832 /// - [`IMG_LoadJPG_IO`]
1833 /// - [`IMG_LoadJXL_IO`]
1834 /// - [`IMG_LoadLBM_IO`]
1835 /// - [`IMG_LoadPNG_IO`]
1836 /// - [`IMG_LoadPNM_IO`]
1837 /// - [`IMG_LoadQOI_IO`]
1838 /// - [`IMG_LoadSVG_IO`]
1839 /// - [`IMG_LoadTGA_IO`]
1840 /// - [`IMG_LoadTIF_IO`]
1841 /// - [`IMG_LoadWEBP_IO`]
1842 /// - [`IMG_LoadXCF_IO`]
1843 /// - [`IMG_LoadXPM_IO`]
1844 /// - [`IMG_LoadXV_IO`]
1845 pub fn IMG_LoadPCX_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1846}
1847
1848unsafe extern "C" {
1849 /// Load a PNG image directly.
1850 ///
1851 /// If you know you definitely have a PNG image, you can call this function,
1852 /// which will skip SDL_image's file format detection routines. Generally it's
1853 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1854 /// interface available here.
1855 ///
1856 /// ## Parameters
1857 /// - `src`: an [`SDL_IOStream`] to load image data from.
1858 ///
1859 /// ## Return value
1860 /// Returns SDL surface, or NULL on error.
1861 ///
1862 /// ## Availability
1863 /// This function is available since SDL_image 3.0.0.
1864 ///
1865 /// ## See also
1866 /// - [`IMG_LoadAVIF_IO`]
1867 /// - [`IMG_LoadBMP_IO`]
1868 /// - [`IMG_LoadCUR_IO`]
1869 /// - [`IMG_LoadGIF_IO`]
1870 /// - [`IMG_LoadICO_IO`]
1871 /// - [`IMG_LoadJPG_IO`]
1872 /// - [`IMG_LoadJXL_IO`]
1873 /// - [`IMG_LoadLBM_IO`]
1874 /// - [`IMG_LoadPCX_IO`]
1875 /// - [`IMG_LoadPNM_IO`]
1876 /// - [`IMG_LoadQOI_IO`]
1877 /// - [`IMG_LoadSVG_IO`]
1878 /// - [`IMG_LoadTGA_IO`]
1879 /// - [`IMG_LoadTIF_IO`]
1880 /// - [`IMG_LoadWEBP_IO`]
1881 /// - [`IMG_LoadXCF_IO`]
1882 /// - [`IMG_LoadXPM_IO`]
1883 /// - [`IMG_LoadXV_IO`]
1884 pub fn IMG_LoadPNG_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1885}
1886
1887unsafe extern "C" {
1888 /// Load a PNM image directly.
1889 ///
1890 /// If you know you definitely have a PNM image, you can call this function,
1891 /// which will skip SDL_image's file format detection routines. Generally it's
1892 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1893 /// interface available here.
1894 ///
1895 /// ## Parameters
1896 /// - `src`: an [`SDL_IOStream`] to load image data from.
1897 ///
1898 /// ## Return value
1899 /// Returns SDL surface, or NULL on error.
1900 ///
1901 /// ## Availability
1902 /// This function is available since SDL_image 3.0.0.
1903 ///
1904 /// ## See also
1905 /// - [`IMG_LoadAVIF_IO`]
1906 /// - [`IMG_LoadBMP_IO`]
1907 /// - [`IMG_LoadCUR_IO`]
1908 /// - [`IMG_LoadGIF_IO`]
1909 /// - [`IMG_LoadICO_IO`]
1910 /// - [`IMG_LoadJPG_IO`]
1911 /// - [`IMG_LoadJXL_IO`]
1912 /// - [`IMG_LoadLBM_IO`]
1913 /// - [`IMG_LoadPCX_IO`]
1914 /// - [`IMG_LoadPNG_IO`]
1915 /// - [`IMG_LoadQOI_IO`]
1916 /// - [`IMG_LoadSVG_IO`]
1917 /// - [`IMG_LoadTGA_IO`]
1918 /// - [`IMG_LoadTIF_IO`]
1919 /// - [`IMG_LoadWEBP_IO`]
1920 /// - [`IMG_LoadXCF_IO`]
1921 /// - [`IMG_LoadXPM_IO`]
1922 /// - [`IMG_LoadXV_IO`]
1923 pub fn IMG_LoadPNM_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1924}
1925
1926unsafe extern "C" {
1927 /// Load a SVG image directly.
1928 ///
1929 /// If you know you definitely have a SVG image, you can call this function,
1930 /// which will skip SDL_image's file format detection routines. Generally it's
1931 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
1932 /// interface available here.
1933 ///
1934 /// ## Parameters
1935 /// - `src`: an [`SDL_IOStream`] to load image data from.
1936 ///
1937 /// ## Return value
1938 /// Returns SDL surface, or NULL on error.
1939 ///
1940 /// ## Availability
1941 /// This function is available since SDL_image 3.0.0.
1942 ///
1943 /// ## See also
1944 /// - [`IMG_LoadAVIF_IO`]
1945 /// - [`IMG_LoadBMP_IO`]
1946 /// - [`IMG_LoadCUR_IO`]
1947 /// - [`IMG_LoadGIF_IO`]
1948 /// - [`IMG_LoadICO_IO`]
1949 /// - [`IMG_LoadJPG_IO`]
1950 /// - [`IMG_LoadJXL_IO`]
1951 /// - [`IMG_LoadLBM_IO`]
1952 /// - [`IMG_LoadPCX_IO`]
1953 /// - [`IMG_LoadPNG_IO`]
1954 /// - [`IMG_LoadPNM_IO`]
1955 /// - [`IMG_LoadQOI_IO`]
1956 /// - [`IMG_LoadSizedSVG_IO`]
1957 /// - [`IMG_LoadTGA_IO`]
1958 /// - [`IMG_LoadTIF_IO`]
1959 /// - [`IMG_LoadWEBP_IO`]
1960 /// - [`IMG_LoadXCF_IO`]
1961 /// - [`IMG_LoadXPM_IO`]
1962 /// - [`IMG_LoadXV_IO`]
1963 pub fn IMG_LoadSVG_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
1964}
1965
1966unsafe extern "C" {
1967 /// Load an SVG image, scaled to a specific size.
1968 ///
1969 /// Since SVG files are resolution-independent, you specify the size you would
1970 /// like the output image to be and it will be generated at those dimensions.
1971 ///
1972 /// Either width or height may be 0 and the image will be auto-sized to
1973 /// preserve aspect ratio.
1974 ///
1975 /// When done with the returned surface, the app should dispose of it with a
1976 /// call to [`SDL_DestroySurface()`].
1977 ///
1978 /// ## Parameters
1979 /// - `src`: an [`SDL_IOStream`] to load SVG data from.
1980 /// - `width`: desired width of the generated surface, in pixels.
1981 /// - `height`: desired height of the generated surface, in pixels.
1982 ///
1983 /// ## Return value
1984 /// Returns a new SDL surface, or NULL on error.
1985 ///
1986 /// ## Availability
1987 /// This function is available since SDL_image 3.0.0.
1988 ///
1989 /// ## See also
1990 /// - [`IMG_LoadSVG_IO`]
1991 pub fn IMG_LoadSizedSVG_IO(
1992 src: *mut SDL_IOStream,
1993 width: ::core::ffi::c_int,
1994 height: ::core::ffi::c_int,
1995 ) -> *mut SDL_Surface;
1996}
1997
1998unsafe extern "C" {
1999 /// Load a QOI image directly.
2000 ///
2001 /// If you know you definitely have a QOI image, you can call this function,
2002 /// which will skip SDL_image's file format detection routines. Generally it's
2003 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
2004 /// interface available here.
2005 ///
2006 /// ## Parameters
2007 /// - `src`: an [`SDL_IOStream`] to load image data from.
2008 ///
2009 /// ## Return value
2010 /// Returns SDL surface, or NULL on error.
2011 ///
2012 /// ## Availability
2013 /// This function is available since SDL_image 3.0.0.
2014 ///
2015 /// ## See also
2016 /// - [`IMG_LoadAVIF_IO`]
2017 /// - [`IMG_LoadBMP_IO`]
2018 /// - [`IMG_LoadCUR_IO`]
2019 /// - [`IMG_LoadGIF_IO`]
2020 /// - [`IMG_LoadICO_IO`]
2021 /// - [`IMG_LoadJPG_IO`]
2022 /// - [`IMG_LoadJXL_IO`]
2023 /// - [`IMG_LoadLBM_IO`]
2024 /// - [`IMG_LoadPCX_IO`]
2025 /// - [`IMG_LoadPNG_IO`]
2026 /// - [`IMG_LoadPNM_IO`]
2027 /// - [`IMG_LoadSVG_IO`]
2028 /// - [`IMG_LoadTGA_IO`]
2029 /// - [`IMG_LoadTIF_IO`]
2030 /// - [`IMG_LoadWEBP_IO`]
2031 /// - [`IMG_LoadXCF_IO`]
2032 /// - [`IMG_LoadXPM_IO`]
2033 /// - [`IMG_LoadXV_IO`]
2034 pub fn IMG_LoadQOI_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
2035}
2036
2037unsafe extern "C" {
2038 /// Load a TGA image directly.
2039 ///
2040 /// If you know you definitely have a TGA image, you can call this function,
2041 /// which will skip SDL_image's file format detection routines. Generally it's
2042 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
2043 /// interface available here.
2044 ///
2045 /// ## Parameters
2046 /// - `src`: an [`SDL_IOStream`] to load image data from.
2047 ///
2048 /// ## Return value
2049 /// Returns SDL surface, or NULL on error.
2050 ///
2051 /// ## Availability
2052 /// This function is available since SDL_image 3.0.0.
2053 ///
2054 /// ## See also
2055 /// - [`IMG_LoadAVIF_IO`]
2056 /// - [`IMG_LoadBMP_IO`]
2057 /// - [`IMG_LoadCUR_IO`]
2058 /// - [`IMG_LoadGIF_IO`]
2059 /// - [`IMG_LoadICO_IO`]
2060 /// - [`IMG_LoadJPG_IO`]
2061 /// - [`IMG_LoadJXL_IO`]
2062 /// - [`IMG_LoadLBM_IO`]
2063 /// - [`IMG_LoadPCX_IO`]
2064 /// - [`IMG_LoadPNG_IO`]
2065 /// - [`IMG_LoadPNM_IO`]
2066 /// - [`IMG_LoadQOI_IO`]
2067 /// - [`IMG_LoadSVG_IO`]
2068 /// - [`IMG_LoadTIF_IO`]
2069 /// - [`IMG_LoadWEBP_IO`]
2070 /// - [`IMG_LoadXCF_IO`]
2071 /// - [`IMG_LoadXPM_IO`]
2072 /// - [`IMG_LoadXV_IO`]
2073 pub fn IMG_LoadTGA_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
2074}
2075
2076unsafe extern "C" {
2077 /// Load a TIFF image directly.
2078 ///
2079 /// If you know you definitely have a TIFF image, you can call this function,
2080 /// which will skip SDL_image's file format detection routines. Generally it's
2081 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
2082 /// interface available here.
2083 ///
2084 /// ## Parameters
2085 /// - `src`: an [`SDL_IOStream`] to load image data from.
2086 ///
2087 /// ## Return value
2088 /// Returns SDL surface, or NULL on error.
2089 ///
2090 /// ## Availability
2091 /// This function is available since SDL_image 3.0.0.
2092 ///
2093 /// ## See also
2094 /// - [`IMG_LoadAVIF_IO`]
2095 /// - [`IMG_LoadBMP_IO`]
2096 /// - [`IMG_LoadCUR_IO`]
2097 /// - [`IMG_LoadGIF_IO`]
2098 /// - [`IMG_LoadICO_IO`]
2099 /// - [`IMG_LoadJPG_IO`]
2100 /// - [`IMG_LoadJXL_IO`]
2101 /// - [`IMG_LoadLBM_IO`]
2102 /// - [`IMG_LoadPCX_IO`]
2103 /// - [`IMG_LoadPNG_IO`]
2104 /// - [`IMG_LoadPNM_IO`]
2105 /// - [`IMG_LoadQOI_IO`]
2106 /// - [`IMG_LoadSVG_IO`]
2107 /// - [`IMG_LoadTGA_IO`]
2108 /// - [`IMG_LoadWEBP_IO`]
2109 /// - [`IMG_LoadXCF_IO`]
2110 /// - [`IMG_LoadXPM_IO`]
2111 /// - [`IMG_LoadXV_IO`]
2112 pub fn IMG_LoadTIF_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
2113}
2114
2115unsafe extern "C" {
2116 /// Load a WEBP image directly.
2117 ///
2118 /// If you know you definitely have a WEBP image, you can call this function,
2119 /// which will skip SDL_image's file format detection routines. Generally it's
2120 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
2121 /// interface available here.
2122 ///
2123 /// ## Parameters
2124 /// - `src`: an [`SDL_IOStream`] to load image data from.
2125 ///
2126 /// ## Return value
2127 /// Returns SDL surface, or NULL on error.
2128 ///
2129 /// ## Availability
2130 /// This function is available since SDL_image 3.0.0.
2131 ///
2132 /// ## See also
2133 /// - [`IMG_LoadAVIF_IO`]
2134 /// - [`IMG_LoadBMP_IO`]
2135 /// - [`IMG_LoadCUR_IO`]
2136 /// - [`IMG_LoadGIF_IO`]
2137 /// - [`IMG_LoadICO_IO`]
2138 /// - [`IMG_LoadJPG_IO`]
2139 /// - [`IMG_LoadJXL_IO`]
2140 /// - [`IMG_LoadLBM_IO`]
2141 /// - [`IMG_LoadPCX_IO`]
2142 /// - [`IMG_LoadPNG_IO`]
2143 /// - [`IMG_LoadPNM_IO`]
2144 /// - [`IMG_LoadQOI_IO`]
2145 /// - [`IMG_LoadSVG_IO`]
2146 /// - [`IMG_LoadTGA_IO`]
2147 /// - [`IMG_LoadTIF_IO`]
2148 /// - [`IMG_LoadXCF_IO`]
2149 /// - [`IMG_LoadXPM_IO`]
2150 /// - [`IMG_LoadXV_IO`]
2151 pub fn IMG_LoadWEBP_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
2152}
2153
2154unsafe extern "C" {
2155 /// Load a XCF image directly.
2156 ///
2157 /// If you know you definitely have a XCF image, you can call this function,
2158 /// which will skip SDL_image's file format detection routines. Generally it's
2159 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
2160 /// interface available here.
2161 ///
2162 /// ## Parameters
2163 /// - `src`: an [`SDL_IOStream`] to load image data from.
2164 ///
2165 /// ## Return value
2166 /// Returns SDL surface, or NULL on error.
2167 ///
2168 /// ## Availability
2169 /// This function is available since SDL_image 3.0.0.
2170 ///
2171 /// ## See also
2172 /// - [`IMG_LoadAVIF_IO`]
2173 /// - [`IMG_LoadBMP_IO`]
2174 /// - [`IMG_LoadCUR_IO`]
2175 /// - [`IMG_LoadGIF_IO`]
2176 /// - [`IMG_LoadICO_IO`]
2177 /// - [`IMG_LoadJPG_IO`]
2178 /// - [`IMG_LoadJXL_IO`]
2179 /// - [`IMG_LoadLBM_IO`]
2180 /// - [`IMG_LoadPCX_IO`]
2181 /// - [`IMG_LoadPNG_IO`]
2182 /// - [`IMG_LoadPNM_IO`]
2183 /// - [`IMG_LoadQOI_IO`]
2184 /// - [`IMG_LoadSVG_IO`]
2185 /// - [`IMG_LoadTGA_IO`]
2186 /// - [`IMG_LoadTIF_IO`]
2187 /// - [`IMG_LoadWEBP_IO`]
2188 /// - [`IMG_LoadXPM_IO`]
2189 /// - [`IMG_LoadXV_IO`]
2190 pub fn IMG_LoadXCF_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
2191}
2192
2193unsafe extern "C" {
2194 /// Load a XPM image directly.
2195 ///
2196 /// If you know you definitely have a XPM image, you can call this function,
2197 /// which will skip SDL_image's file format detection routines. Generally it's
2198 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
2199 /// interface available here.
2200 ///
2201 /// ## Parameters
2202 /// - `src`: an [`SDL_IOStream`] to load image data from.
2203 ///
2204 /// ## Return value
2205 /// Returns SDL surface, or NULL on error.
2206 ///
2207 /// ## Availability
2208 /// This function is available since SDL_image 3.0.0.
2209 ///
2210 /// ## See also
2211 /// - [`IMG_LoadAVIF_IO`]
2212 /// - [`IMG_LoadBMP_IO`]
2213 /// - [`IMG_LoadCUR_IO`]
2214 /// - [`IMG_LoadGIF_IO`]
2215 /// - [`IMG_LoadICO_IO`]
2216 /// - [`IMG_LoadJPG_IO`]
2217 /// - [`IMG_LoadJXL_IO`]
2218 /// - [`IMG_LoadLBM_IO`]
2219 /// - [`IMG_LoadPCX_IO`]
2220 /// - [`IMG_LoadPNG_IO`]
2221 /// - [`IMG_LoadPNM_IO`]
2222 /// - [`IMG_LoadQOI_IO`]
2223 /// - [`IMG_LoadSVG_IO`]
2224 /// - [`IMG_LoadTGA_IO`]
2225 /// - [`IMG_LoadTIF_IO`]
2226 /// - [`IMG_LoadWEBP_IO`]
2227 /// - [`IMG_LoadXCF_IO`]
2228 /// - [`IMG_LoadXV_IO`]
2229 pub fn IMG_LoadXPM_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
2230}
2231
2232unsafe extern "C" {
2233 /// Load a XV image directly.
2234 ///
2235 /// If you know you definitely have a XV image, you can call this function,
2236 /// which will skip SDL_image's file format detection routines. Generally it's
2237 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
2238 /// interface available here.
2239 ///
2240 /// ## Parameters
2241 /// - `src`: an [`SDL_IOStream`] to load image data from.
2242 ///
2243 /// ## Return value
2244 /// Returns SDL surface, or NULL on error.
2245 ///
2246 /// ## Availability
2247 /// This function is available since SDL_image 3.0.0.
2248 ///
2249 /// ## See also
2250 /// - [`IMG_LoadAVIF_IO`]
2251 /// - [`IMG_LoadBMP_IO`]
2252 /// - [`IMG_LoadCUR_IO`]
2253 /// - [`IMG_LoadGIF_IO`]
2254 /// - [`IMG_LoadICO_IO`]
2255 /// - [`IMG_LoadJPG_IO`]
2256 /// - [`IMG_LoadJXL_IO`]
2257 /// - [`IMG_LoadLBM_IO`]
2258 /// - [`IMG_LoadPCX_IO`]
2259 /// - [`IMG_LoadPNG_IO`]
2260 /// - [`IMG_LoadPNM_IO`]
2261 /// - [`IMG_LoadQOI_IO`]
2262 /// - [`IMG_LoadSVG_IO`]
2263 /// - [`IMG_LoadTGA_IO`]
2264 /// - [`IMG_LoadTIF_IO`]
2265 /// - [`IMG_LoadWEBP_IO`]
2266 /// - [`IMG_LoadXCF_IO`]
2267 /// - [`IMG_LoadXPM_IO`]
2268 pub fn IMG_LoadXV_IO(src: *mut SDL_IOStream) -> *mut SDL_Surface;
2269}
2270
2271unsafe extern "C" {
2272 /// Load an XPM image from a memory array.
2273 ///
2274 /// The returned surface will be an 8bpp indexed surface, if possible,
2275 /// otherwise it will be 32bpp. If you always want 32-bit data, use
2276 /// [`IMG_ReadXPMFromArrayToRGB888()`] instead.
2277 ///
2278 /// When done with the returned surface, the app should dispose of it with a
2279 /// call to [`SDL_DestroySurface()`].
2280 ///
2281 /// ## Parameters
2282 /// - `xpm`: a null-terminated array of strings that comprise XPM data.
2283 ///
2284 /// ## Return value
2285 /// Returns a new SDL surface, or NULL on error.
2286 ///
2287 /// ## Availability
2288 /// This function is available since SDL_image 3.0.0.
2289 ///
2290 /// ## See also
2291 /// - [`IMG_ReadXPMFromArrayToRGB888`]
2292 pub fn IMG_ReadXPMFromArray(xpm: *mut *mut ::core::ffi::c_char) -> *mut SDL_Surface;
2293}
2294
2295unsafe extern "C" {
2296 /// Load an XPM image from a memory array.
2297 ///
2298 /// The returned surface will always be a 32-bit RGB surface. If you want 8-bit
2299 /// indexed colors (and the XPM data allows it), use [`IMG_ReadXPMFromArray()`]
2300 /// instead.
2301 ///
2302 /// When done with the returned surface, the app should dispose of it with a
2303 /// call to [`SDL_DestroySurface()`].
2304 ///
2305 /// ## Parameters
2306 /// - `xpm`: a null-terminated array of strings that comprise XPM data.
2307 ///
2308 /// ## Return value
2309 /// Returns a new SDL surface, or NULL on error.
2310 ///
2311 /// ## Availability
2312 /// This function is available since SDL_image 3.0.0.
2313 ///
2314 /// ## See also
2315 /// - [`IMG_ReadXPMFromArray`]
2316 pub fn IMG_ReadXPMFromArrayToRGB888(xpm: *mut *mut ::core::ffi::c_char) -> *mut SDL_Surface;
2317}
2318
2319unsafe extern "C" {
2320 /// Save an [`SDL_Surface`] into an image file.
2321 ///
2322 /// If the file already exists, it will be overwritten.
2323 ///
2324 /// For formats that accept a quality, a default quality of 90 will be used.
2325 ///
2326 /// ## Parameters
2327 /// - `surface`: the SDL surface to save.
2328 /// - `file`: path on the filesystem to write new file to.
2329 ///
2330 /// ## Return value
2331 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2332 /// information.
2333 ///
2334 /// ## Availability
2335 /// This function is available since SDL_image 3.4.0.
2336 ///
2337 /// ## See also
2338 /// - [`IMG_SaveTyped_IO`]
2339 /// - [`IMG_SaveAVIF`]
2340 /// - [`IMG_SaveBMP`]
2341 /// - [`IMG_SaveCUR`]
2342 /// - [`IMG_SaveGIF`]
2343 /// - [`IMG_SaveICO`]
2344 /// - [`IMG_SaveJPG`]
2345 /// - [`IMG_SavePNG`]
2346 /// - [`IMG_SaveTGA`]
2347 /// - [`IMG_SaveWEBP`]
2348 pub fn IMG_Save(
2349 surface: *mut SDL_Surface,
2350 file: *const ::core::ffi::c_char,
2351 ) -> ::core::primitive::bool;
2352}
2353
2354unsafe extern "C" {
2355 /// Save an [`SDL_Surface`] into formatted image data, via an [`SDL_IOStream`].
2356 ///
2357 /// If you just want to save to a filename, you can use [`IMG_Save()`] instead.
2358 ///
2359 /// If `closeio` is true, `dst` will be closed before returning, whether this
2360 /// function succeeds or not.
2361 ///
2362 /// For formats that accept a quality, a default quality of 90 will be used.
2363 ///
2364 /// ## Parameters
2365 /// - `surface`: the SDL surface to save.
2366 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2367 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2368 /// to leave it open.
2369 /// - `type`: a filename extension that represent this data ("BMP", "GIF",
2370 /// "PNG", etc).
2371 ///
2372 /// ## Return value
2373 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2374 /// information.
2375 ///
2376 /// ## Availability
2377 /// This function is available since SDL_image 3.4.0.
2378 ///
2379 /// ## See also
2380 /// - [`IMG_Save`]
2381 /// - [`IMG_SaveAVIF_IO`]
2382 /// - [`IMG_SaveBMP_IO`]
2383 /// - [`IMG_SaveCUR_IO`]
2384 /// - [`IMG_SaveGIF_IO`]
2385 /// - [`IMG_SaveICO_IO`]
2386 /// - [`IMG_SaveJPG_IO`]
2387 /// - [`IMG_SavePNG_IO`]
2388 /// - [`IMG_SaveTGA_IO`]
2389 /// - [`IMG_SaveWEBP_IO`]
2390 pub fn IMG_SaveTyped_IO(
2391 surface: *mut SDL_Surface,
2392 dst: *mut SDL_IOStream,
2393 closeio: ::core::primitive::bool,
2394 r#type: *const ::core::ffi::c_char,
2395 ) -> ::core::primitive::bool;
2396}
2397
2398unsafe extern "C" {
2399 /// Save an [`SDL_Surface`] into a AVIF image file.
2400 ///
2401 /// If the file already exists, it will be overwritten.
2402 ///
2403 /// ## Parameters
2404 /// - `surface`: the SDL surface to save.
2405 /// - `file`: path on the filesystem to write new file to.
2406 /// - `quality`: the desired quality, ranging between 0 (lowest) and 100
2407 /// (highest).
2408 ///
2409 /// ## Return value
2410 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2411 /// information.
2412 ///
2413 /// ## Availability
2414 /// This function is available since SDL_image 3.0.0.
2415 ///
2416 /// ## See also
2417 /// - [`IMG_SaveAVIF_IO`]
2418 pub fn IMG_SaveAVIF(
2419 surface: *mut SDL_Surface,
2420 file: *const ::core::ffi::c_char,
2421 quality: ::core::ffi::c_int,
2422 ) -> ::core::primitive::bool;
2423}
2424
2425unsafe extern "C" {
2426 /// Save an [`SDL_Surface`] into AVIF image data, via an [`SDL_IOStream`].
2427 ///
2428 /// If you just want to save to a filename, you can use [`IMG_SaveAVIF()`] instead.
2429 ///
2430 /// If `closeio` is true, `dst` will be closed before returning, whether this
2431 /// function succeeds or not.
2432 ///
2433 /// ## Parameters
2434 /// - `surface`: the SDL surface to save.
2435 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2436 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2437 /// to leave it open.
2438 /// - `quality`: the desired quality, ranging between 0 (lowest) and 100
2439 /// (highest).
2440 ///
2441 /// ## Return value
2442 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2443 /// information.
2444 ///
2445 /// ## Availability
2446 /// This function is available since SDL_image 3.0.0.
2447 ///
2448 /// ## See also
2449 /// - [`IMG_SaveAVIF`]
2450 pub fn IMG_SaveAVIF_IO(
2451 surface: *mut SDL_Surface,
2452 dst: *mut SDL_IOStream,
2453 closeio: ::core::primitive::bool,
2454 quality: ::core::ffi::c_int,
2455 ) -> ::core::primitive::bool;
2456}
2457
2458unsafe extern "C" {
2459 /// Save an [`SDL_Surface`] into a BMP image file.
2460 ///
2461 /// If the file already exists, it will be overwritten.
2462 ///
2463 /// ## Parameters
2464 /// - `surface`: the SDL surface to save.
2465 /// - `file`: path on the filesystem to write new file to.
2466 ///
2467 /// ## Return value
2468 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2469 /// information.
2470 ///
2471 /// ## Availability
2472 /// This function is available since SDL_image 3.4.0.
2473 ///
2474 /// ## See also
2475 /// - [`IMG_SaveBMP_IO`]
2476 pub fn IMG_SaveBMP(
2477 surface: *mut SDL_Surface,
2478 file: *const ::core::ffi::c_char,
2479 ) -> ::core::primitive::bool;
2480}
2481
2482unsafe extern "C" {
2483 /// Save an [`SDL_Surface`] into BMP image data, via an [`SDL_IOStream`].
2484 ///
2485 /// If you just want to save to a filename, you can use [`IMG_SaveBMP()`] instead.
2486 ///
2487 /// If `closeio` is true, `dst` will be closed before returning, whether this
2488 /// function succeeds or not.
2489 ///
2490 /// ## Parameters
2491 /// - `surface`: the SDL surface to save.
2492 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2493 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2494 /// to leave it open.
2495 ///
2496 /// ## Return value
2497 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2498 /// information.
2499 ///
2500 /// ## Availability
2501 /// This function is available since SDL_image 3.4.0.
2502 ///
2503 /// ## See also
2504 /// - [`IMG_SaveBMP`]
2505 pub fn IMG_SaveBMP_IO(
2506 surface: *mut SDL_Surface,
2507 dst: *mut SDL_IOStream,
2508 closeio: ::core::primitive::bool,
2509 ) -> ::core::primitive::bool;
2510}
2511
2512unsafe extern "C" {
2513 /// Save an [`SDL_Surface`] into a CUR image file.
2514 ///
2515 /// If the file already exists, it will be overwritten.
2516 ///
2517 /// ## Parameters
2518 /// - `surface`: the SDL surface to save.
2519 /// - `file`: path on the filesystem to write new file to.
2520 ///
2521 /// ## Return value
2522 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2523 /// information.
2524 ///
2525 /// ## Availability
2526 /// This function is available since SDL_image 3.4.0.
2527 ///
2528 /// ## See also
2529 /// - [`IMG_SaveCUR_IO`]
2530 pub fn IMG_SaveCUR(
2531 surface: *mut SDL_Surface,
2532 file: *const ::core::ffi::c_char,
2533 ) -> ::core::primitive::bool;
2534}
2535
2536unsafe extern "C" {
2537 /// Save an [`SDL_Surface`] into CUR image data, via an [`SDL_IOStream`].
2538 ///
2539 /// If you just want to save to a filename, you can use [`IMG_SaveCUR()`] instead.
2540 ///
2541 /// If `closeio` is true, `dst` will be closed before returning, whether this
2542 /// function succeeds or not.
2543 ///
2544 /// ## Parameters
2545 /// - `surface`: the SDL surface to save.
2546 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2547 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2548 /// to leave it open.
2549 ///
2550 /// ## Return value
2551 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2552 /// information.
2553 ///
2554 /// ## Availability
2555 /// This function is available since SDL_image 3.4.0.
2556 ///
2557 /// ## See also
2558 /// - [`IMG_SaveCUR`]
2559 pub fn IMG_SaveCUR_IO(
2560 surface: *mut SDL_Surface,
2561 dst: *mut SDL_IOStream,
2562 closeio: ::core::primitive::bool,
2563 ) -> ::core::primitive::bool;
2564}
2565
2566unsafe extern "C" {
2567 /// Save an [`SDL_Surface`] into a GIF image file.
2568 ///
2569 /// If the file already exists, it will be overwritten.
2570 ///
2571 /// ## Parameters
2572 /// - `surface`: the SDL surface to save.
2573 /// - `file`: path on the filesystem to write new file to.
2574 ///
2575 /// ## Return value
2576 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2577 /// information.
2578 ///
2579 /// ## Availability
2580 /// This function is available since SDL_image 3.4.0.
2581 ///
2582 /// ## See also
2583 /// - [`IMG_SaveGIF_IO`]
2584 pub fn IMG_SaveGIF(
2585 surface: *mut SDL_Surface,
2586 file: *const ::core::ffi::c_char,
2587 ) -> ::core::primitive::bool;
2588}
2589
2590unsafe extern "C" {
2591 /// Save an [`SDL_Surface`] into GIF image data, via an [`SDL_IOStream`].
2592 ///
2593 /// If you just want to save to a filename, you can use [`IMG_SaveGIF()`] instead.
2594 ///
2595 /// If `closeio` is true, `dst` will be closed before returning, whether this
2596 /// function succeeds or not.
2597 ///
2598 /// ## Parameters
2599 /// - `surface`: the SDL surface to save.
2600 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2601 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2602 /// to leave it open.
2603 ///
2604 /// ## Return value
2605 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2606 /// information.
2607 ///
2608 /// ## Availability
2609 /// This function is available since SDL_image 3.4.0.
2610 ///
2611 /// ## See also
2612 /// - [`IMG_SaveGIF`]
2613 pub fn IMG_SaveGIF_IO(
2614 surface: *mut SDL_Surface,
2615 dst: *mut SDL_IOStream,
2616 closeio: ::core::primitive::bool,
2617 ) -> ::core::primitive::bool;
2618}
2619
2620unsafe extern "C" {
2621 /// Save an [`SDL_Surface`] into a ICO image file.
2622 ///
2623 /// If the file already exists, it will be overwritten.
2624 ///
2625 /// ## Parameters
2626 /// - `surface`: the SDL surface to save.
2627 /// - `file`: path on the filesystem to write new file to.
2628 ///
2629 /// ## Return value
2630 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2631 /// information.
2632 ///
2633 /// ## Availability
2634 /// This function is available since SDL_image 3.4.0.
2635 ///
2636 /// ## See also
2637 /// - [`IMG_SaveICO_IO`]
2638 pub fn IMG_SaveICO(
2639 surface: *mut SDL_Surface,
2640 file: *const ::core::ffi::c_char,
2641 ) -> ::core::primitive::bool;
2642}
2643
2644unsafe extern "C" {
2645 /// Save an [`SDL_Surface`] into ICO image data, via an [`SDL_IOStream`].
2646 ///
2647 /// If you just want to save to a filename, you can use [`IMG_SaveICO()`] instead.
2648 ///
2649 /// If `closeio` is true, `dst` will be closed before returning, whether this
2650 /// function succeeds or not.
2651 ///
2652 /// ## Parameters
2653 /// - `surface`: the SDL surface to save.
2654 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2655 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2656 /// to leave it open.
2657 ///
2658 /// ## Return value
2659 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2660 /// information.
2661 ///
2662 /// ## Availability
2663 /// This function is available since SDL_image 3.4.0.
2664 ///
2665 /// ## See also
2666 /// - [`IMG_SaveICO`]
2667 pub fn IMG_SaveICO_IO(
2668 surface: *mut SDL_Surface,
2669 dst: *mut SDL_IOStream,
2670 closeio: ::core::primitive::bool,
2671 ) -> ::core::primitive::bool;
2672}
2673
2674unsafe extern "C" {
2675 /// Save an [`SDL_Surface`] into a JPEG image file.
2676 ///
2677 /// If the file already exists, it will be overwritten.
2678 ///
2679 /// ## Parameters
2680 /// - `surface`: the SDL surface to save.
2681 /// - `file`: path on the filesystem to write new file to.
2682 /// - `quality`: \[0; 33\] is Lowest quality, \[34; 66\] is Middle quality, [67;
2683 /// 100\] is Highest quality.
2684 ///
2685 /// ## Return value
2686 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2687 /// information.
2688 ///
2689 /// ## Availability
2690 /// This function is available since SDL_image 3.0.0.
2691 ///
2692 /// ## See also
2693 /// - [`IMG_SaveJPG_IO`]
2694 pub fn IMG_SaveJPG(
2695 surface: *mut SDL_Surface,
2696 file: *const ::core::ffi::c_char,
2697 quality: ::core::ffi::c_int,
2698 ) -> ::core::primitive::bool;
2699}
2700
2701unsafe extern "C" {
2702 /// Save an [`SDL_Surface`] into JPEG image data, via an [`SDL_IOStream`].
2703 ///
2704 /// If you just want to save to a filename, you can use [`IMG_SaveJPG()`] instead.
2705 ///
2706 /// If `closeio` is true, `dst` will be closed before returning, whether this
2707 /// function succeeds or not.
2708 ///
2709 /// ## Parameters
2710 /// - `surface`: the SDL surface to save.
2711 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2712 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2713 /// to leave it open.
2714 /// - `quality`: \[0; 33\] is Lowest quality, \[34; 66\] is Middle quality, [67;
2715 /// 100\] is Highest quality.
2716 ///
2717 /// ## Return value
2718 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2719 /// information.
2720 ///
2721 /// ## Availability
2722 /// This function is available since SDL_image 3.0.0.
2723 ///
2724 /// ## See also
2725 /// - [`IMG_SaveJPG`]
2726 pub fn IMG_SaveJPG_IO(
2727 surface: *mut SDL_Surface,
2728 dst: *mut SDL_IOStream,
2729 closeio: ::core::primitive::bool,
2730 quality: ::core::ffi::c_int,
2731 ) -> ::core::primitive::bool;
2732}
2733
2734unsafe extern "C" {
2735 /// Save an [`SDL_Surface`] into a PNG image file.
2736 ///
2737 /// If the file already exists, it will be overwritten.
2738 ///
2739 /// ## Parameters
2740 /// - `surface`: the SDL surface to save.
2741 /// - `file`: path on the filesystem to write new file to.
2742 ///
2743 /// ## Return value
2744 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2745 /// information.
2746 ///
2747 /// ## Availability
2748 /// This function is available since SDL_image 3.0.0.
2749 ///
2750 /// ## See also
2751 /// - [`IMG_SavePNG_IO`]
2752 pub fn IMG_SavePNG(
2753 surface: *mut SDL_Surface,
2754 file: *const ::core::ffi::c_char,
2755 ) -> ::core::primitive::bool;
2756}
2757
2758unsafe extern "C" {
2759 /// Save an [`SDL_Surface`] into PNG image data, via an [`SDL_IOStream`].
2760 ///
2761 /// If you just want to save to a filename, you can use [`IMG_SavePNG()`] instead.
2762 ///
2763 /// If `closeio` is true, `dst` will be closed before returning, whether this
2764 /// function succeeds or not.
2765 ///
2766 /// ## Parameters
2767 /// - `surface`: the SDL surface to save.
2768 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2769 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2770 /// to leave it open.
2771 ///
2772 /// ## Return value
2773 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2774 /// information.
2775 ///
2776 /// ## Availability
2777 /// This function is available since SDL_image 3.0.0.
2778 ///
2779 /// ## See also
2780 /// - [`IMG_SavePNG`]
2781 pub fn IMG_SavePNG_IO(
2782 surface: *mut SDL_Surface,
2783 dst: *mut SDL_IOStream,
2784 closeio: ::core::primitive::bool,
2785 ) -> ::core::primitive::bool;
2786}
2787
2788unsafe extern "C" {
2789 /// Save an [`SDL_Surface`] into a TGA image file.
2790 ///
2791 /// If the file already exists, it will be overwritten.
2792 ///
2793 /// ## Parameters
2794 /// - `surface`: the SDL surface to save.
2795 /// - `file`: path on the filesystem to write new file to.
2796 ///
2797 /// ## Return value
2798 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2799 /// information.
2800 ///
2801 /// ## Availability
2802 /// This function is available since SDL_image 3.4.0.
2803 ///
2804 /// ## See also
2805 /// - [`IMG_SaveTGA_IO`]
2806 pub fn IMG_SaveTGA(
2807 surface: *mut SDL_Surface,
2808 file: *const ::core::ffi::c_char,
2809 ) -> ::core::primitive::bool;
2810}
2811
2812unsafe extern "C" {
2813 /// Save an [`SDL_Surface`] into TGA image data, via an [`SDL_IOStream`].
2814 ///
2815 /// If you just want to save to a filename, you can use [`IMG_SaveTGA()`] instead.
2816 ///
2817 /// If `closeio` is true, `dst` will be closed before returning, whether this
2818 /// function succeeds or not.
2819 ///
2820 /// ## Parameters
2821 /// - `surface`: the SDL surface to save.
2822 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2823 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2824 /// to leave it open.
2825 ///
2826 /// ## Return value
2827 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2828 /// information.
2829 ///
2830 /// ## Availability
2831 /// This function is available since SDL_image 3.4.0.
2832 ///
2833 /// ## See also
2834 /// - [`IMG_SaveTGA`]
2835 pub fn IMG_SaveTGA_IO(
2836 surface: *mut SDL_Surface,
2837 dst: *mut SDL_IOStream,
2838 closeio: ::core::primitive::bool,
2839 ) -> ::core::primitive::bool;
2840}
2841
2842unsafe extern "C" {
2843 /// Save an [`SDL_Surface`] into a WEBP image file.
2844 ///
2845 /// If the file already exists, it will be overwritten.
2846 ///
2847 /// ## Parameters
2848 /// - `surface`: the SDL surface to save.
2849 /// - `file`: path on the filesystem to write the new file to.
2850 /// - `quality`: between 0 and 100. For lossy, 0 gives the smallest size and
2851 /// 100 the largest. For lossless, this parameter is the amount
2852 /// of effort put into the compression: 0 is the fastest but
2853 /// gives larger files compared to the slowest, but best, 100.
2854 ///
2855 /// ## Return value
2856 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2857 /// information.
2858 ///
2859 /// ## Availability
2860 /// This function is available since SDL_image 3.4.0.
2861 ///
2862 /// ## See also
2863 /// - [`IMG_SaveWEBP_IO`]
2864 pub fn IMG_SaveWEBP(
2865 surface: *mut SDL_Surface,
2866 file: *const ::core::ffi::c_char,
2867 quality: ::core::ffi::c_float,
2868 ) -> ::core::primitive::bool;
2869}
2870
2871unsafe extern "C" {
2872 /// Save an [`SDL_Surface`] into WEBP image data, via an [`SDL_IOStream`].
2873 ///
2874 /// If you just want to save to a filename, you can use [`IMG_SaveWEBP()`] instead.
2875 ///
2876 /// If `closeio` is true, `dst` will be closed before returning, whether this
2877 /// function succeeds or not.
2878 ///
2879 /// ## Parameters
2880 /// - `surface`: the SDL surface to save.
2881 /// - `dst`: the [`SDL_IOStream`] to save the image data to.
2882 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2883 /// to leave it open.
2884 /// - `quality`: between 0 and 100. For lossy, 0 gives the smallest size and
2885 /// 100 the largest. For lossless, this parameter is the amount
2886 /// of effort put into the compression: 0 is the fastest but
2887 /// gives larger files compared to the slowest, but best, 100.
2888 ///
2889 /// ## Return value
2890 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
2891 /// information.
2892 ///
2893 /// ## Availability
2894 /// This function is available since SDL_image 3.4.0.
2895 ///
2896 /// ## See also
2897 /// - [`IMG_SaveWEBP`]
2898 pub fn IMG_SaveWEBP_IO(
2899 surface: *mut SDL_Surface,
2900 dst: *mut SDL_IOStream,
2901 closeio: ::core::primitive::bool,
2902 quality: ::core::ffi::c_float,
2903 ) -> ::core::primitive::bool;
2904}
2905
2906/// * Animated image support
2907#[repr(C)]
2908#[cfg_attr(feature = "debug-impls", derive(Debug))]
2909pub struct IMG_Animation {
2910 /// The width of the frames
2911 pub w: ::core::ffi::c_int,
2912 /// The height of the frames
2913 pub h: ::core::ffi::c_int,
2914 /// The number of frames
2915 pub count: ::core::ffi::c_int,
2916 /// An array of frames
2917 pub frames: *mut *mut SDL_Surface,
2918 /// An array of frame delays, in milliseconds
2919 pub delays: *mut ::core::ffi::c_int,
2920}
2921
2922impl ::core::default::Default for IMG_Animation {
2923 /// Initialize all fields to zero
2924 #[inline(always)]
2925 fn default() -> Self {
2926 unsafe { ::core::mem::MaybeUninit::<Self>::zeroed().assume_init() }
2927 }
2928}
2929
2930unsafe extern "C" {
2931 /// Load an animation from a file.
2932 ///
2933 /// When done with the returned animation, the app should dispose of it with a
2934 /// call to [`IMG_FreeAnimation()`].
2935 ///
2936 /// ## Parameters
2937 /// - `file`: path on the filesystem containing an animated image.
2938 ///
2939 /// ## Return value
2940 /// Returns a new [`IMG_Animation`], or NULL on error.
2941 ///
2942 /// ## Availability
2943 /// This function is available since SDL_image 3.0.0.
2944 ///
2945 /// ## See also
2946 /// - [`IMG_CreateAnimatedCursor`]
2947 /// - [`IMG_LoadAnimation_IO`]
2948 /// - [`IMG_LoadAnimationTyped_IO`]
2949 /// - [`IMG_LoadANIAnimation_IO`]
2950 /// - [`IMG_LoadAPNGAnimation_IO`]
2951 /// - [`IMG_LoadAVIFAnimation_IO`]
2952 /// - [`IMG_LoadGIFAnimation_IO`]
2953 /// - [`IMG_LoadWEBPAnimation_IO`]
2954 /// - [`IMG_FreeAnimation`]
2955 pub fn IMG_LoadAnimation(file: *const ::core::ffi::c_char) -> *mut IMG_Animation;
2956}
2957
2958unsafe extern "C" {
2959 /// Load an animation from an [`SDL_IOStream`].
2960 ///
2961 /// If `closeio` is true, `src` will be closed before returning, whether this
2962 /// function succeeds or not. SDL_image reads everything it needs from `src`
2963 /// during this call in any case.
2964 ///
2965 /// When done with the returned animation, the app should dispose of it with a
2966 /// call to [`IMG_FreeAnimation()`].
2967 ///
2968 /// ## Parameters
2969 /// - `src`: an [`SDL_IOStream`] that data will be read from.
2970 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
2971 /// to leave it open.
2972 ///
2973 /// ## Return value
2974 /// Returns a new [`IMG_Animation`], or NULL on error.
2975 ///
2976 /// ## Availability
2977 /// This function is available since SDL_image 3.0.0.
2978 ///
2979 /// ## See also
2980 /// - [`IMG_CreateAnimatedCursor`]
2981 /// - [`IMG_LoadAnimation`]
2982 /// - [`IMG_LoadAnimationTyped_IO`]
2983 /// - [`IMG_LoadANIAnimation_IO`]
2984 /// - [`IMG_LoadAPNGAnimation_IO`]
2985 /// - [`IMG_LoadAVIFAnimation_IO`]
2986 /// - [`IMG_LoadGIFAnimation_IO`]
2987 /// - [`IMG_LoadWEBPAnimation_IO`]
2988 /// - [`IMG_FreeAnimation`]
2989 pub fn IMG_LoadAnimation_IO(
2990 src: *mut SDL_IOStream,
2991 closeio: ::core::primitive::bool,
2992 ) -> *mut IMG_Animation;
2993}
2994
2995unsafe extern "C" {
2996 /// Load an animation from an [`SDL_IOStream`].
2997 ///
2998 /// Even though this function accepts a file type, SDL_image may still try
2999 /// other decoders that are capable of detecting file type from the contents of
3000 /// the image data, but may rely on the caller-provided type string for formats
3001 /// that it cannot autodetect. If `type` is NULL, SDL_image will rely solely on
3002 /// its ability to guess the format.
3003 ///
3004 /// If `closeio` is true, `src` will be closed before returning, whether this
3005 /// function succeeds or not. SDL_image reads everything it needs from `src`
3006 /// during this call in any case.
3007 ///
3008 /// When done with the returned animation, the app should dispose of it with a
3009 /// call to [`IMG_FreeAnimation()`].
3010 ///
3011 /// ## Parameters
3012 /// - `src`: an [`SDL_IOStream`] that data will be read from.
3013 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
3014 /// to leave it open.
3015 /// - `type`: a filename extension that represent this data ("GIF", etc).
3016 ///
3017 /// ## Return value
3018 /// Returns a new [`IMG_Animation`], or NULL on error.
3019 ///
3020 /// ## Availability
3021 /// This function is available since SDL_image 3.0.0.
3022 ///
3023 /// ## See also
3024 /// - [`IMG_CreateAnimatedCursor`]
3025 /// - [`IMG_LoadAnimation`]
3026 /// - [`IMG_LoadAnimation_IO`]
3027 /// - [`IMG_LoadANIAnimation_IO`]
3028 /// - [`IMG_LoadAPNGAnimation_IO`]
3029 /// - [`IMG_LoadAVIFAnimation_IO`]
3030 /// - [`IMG_LoadGIFAnimation_IO`]
3031 /// - [`IMG_LoadWEBPAnimation_IO`]
3032 /// - [`IMG_FreeAnimation`]
3033 pub fn IMG_LoadAnimationTyped_IO(
3034 src: *mut SDL_IOStream,
3035 closeio: ::core::primitive::bool,
3036 r#type: *const ::core::ffi::c_char,
3037 ) -> *mut IMG_Animation;
3038}
3039
3040unsafe extern "C" {
3041 /// Load an ANI animation directly from an [`SDL_IOStream`].
3042 ///
3043 /// If you know you definitely have an ANI image, you can call this function,
3044 /// which will skip SDL_image's file format detection routines. Generally, it's
3045 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
3046 /// interface available here.
3047 ///
3048 /// When done with the returned animation, the app should dispose of it with a
3049 /// call to [`IMG_FreeAnimation()`].
3050 ///
3051 /// ## Parameters
3052 /// - `src`: an [`SDL_IOStream`] from which data will be read.
3053 ///
3054 /// ## Return value
3055 /// Returns a new [`IMG_Animation`], or NULL on error.
3056 ///
3057 /// ## Availability
3058 /// This function is available since SDL_image 3.4.0.
3059 ///
3060 /// ## See also
3061 /// - [`IMG_isANI`]
3062 /// - [`IMG_LoadAnimation`]
3063 /// - [`IMG_LoadAnimation_IO`]
3064 /// - [`IMG_LoadAnimationTyped_IO`]
3065 /// - [`IMG_LoadAPNGAnimation_IO`]
3066 /// - [`IMG_LoadAVIFAnimation_IO`]
3067 /// - [`IMG_LoadGIFAnimation_IO`]
3068 /// - [`IMG_LoadWEBPAnimation_IO`]
3069 /// - [`IMG_FreeAnimation`]
3070 pub fn IMG_LoadANIAnimation_IO(src: *mut SDL_IOStream) -> *mut IMG_Animation;
3071}
3072
3073unsafe extern "C" {
3074 /// Load an APNG animation directly from an [`SDL_IOStream`].
3075 ///
3076 /// If you know you definitely have an APNG image, you can call this function,
3077 /// which will skip SDL_image's file format detection routines. Generally, it's
3078 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
3079 /// interface available here.
3080 ///
3081 /// When done with the returned animation, the app should dispose of it with a
3082 /// call to [`IMG_FreeAnimation()`].
3083 ///
3084 /// ## Parameters
3085 /// - `src`: an [`SDL_IOStream`] from which data will be read.
3086 ///
3087 /// ## Return value
3088 /// Returns a new [`IMG_Animation`], or NULL on error.
3089 ///
3090 /// ## Availability
3091 /// This function is available since SDL_image 3.4.0.
3092 ///
3093 /// ## See also
3094 /// - [`IMG_isPNG`]
3095 /// - [`IMG_LoadAnimation`]
3096 /// - [`IMG_LoadAnimation_IO`]
3097 /// - [`IMG_LoadAnimationTyped_IO`]
3098 /// - [`IMG_LoadANIAnimation_IO`]
3099 /// - [`IMG_LoadAVIFAnimation_IO`]
3100 /// - [`IMG_LoadGIFAnimation_IO`]
3101 /// - [`IMG_LoadWEBPAnimation_IO`]
3102 /// - [`IMG_FreeAnimation`]
3103 pub fn IMG_LoadAPNGAnimation_IO(src: *mut SDL_IOStream) -> *mut IMG_Animation;
3104}
3105
3106unsafe extern "C" {
3107 /// Load an AVIF animation directly from an [`SDL_IOStream`].
3108 ///
3109 /// If you know you definitely have an AVIF animation, you can call this
3110 /// function, which will skip SDL_image's file format detection routines.
3111 /// Generally it's better to use the abstract interfaces; also, there is only
3112 /// an [`SDL_IOStream`] interface available here.
3113 ///
3114 /// When done with the returned animation, the app should dispose of it with a
3115 /// call to [`IMG_FreeAnimation()`].
3116 ///
3117 /// ## Parameters
3118 /// - `src`: an [`SDL_IOStream`] that data will be read from.
3119 ///
3120 /// ## Return value
3121 /// Returns a new [`IMG_Animation`], or NULL on error.
3122 ///
3123 /// ## Availability
3124 /// This function is available since SDL_image 3.4.0.
3125 ///
3126 /// ## See also
3127 /// - [`IMG_isAVIF`]
3128 /// - [`IMG_LoadAnimation`]
3129 /// - [`IMG_LoadAnimation_IO`]
3130 /// - [`IMG_LoadAnimationTyped_IO`]
3131 /// - [`IMG_LoadANIAnimation_IO`]
3132 /// - [`IMG_LoadAPNGAnimation_IO`]
3133 /// - [`IMG_LoadGIFAnimation_IO`]
3134 /// - [`IMG_LoadWEBPAnimation_IO`]
3135 /// - [`IMG_FreeAnimation`]
3136 pub fn IMG_LoadAVIFAnimation_IO(src: *mut SDL_IOStream) -> *mut IMG_Animation;
3137}
3138
3139unsafe extern "C" {
3140 /// Load a GIF animation directly.
3141 ///
3142 /// If you know you definitely have a GIF image, you can call this function,
3143 /// which will skip SDL_image's file format detection routines. Generally it's
3144 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
3145 /// interface available here.
3146 ///
3147 /// ## Parameters
3148 /// - `src`: an [`SDL_IOStream`] that data will be read from.
3149 ///
3150 /// ## Return value
3151 /// Returns a new [`IMG_Animation`], or NULL on error.
3152 ///
3153 /// ## Availability
3154 /// This function is available since SDL_image 3.0.0.
3155 ///
3156 /// ## See also
3157 /// - [`IMG_isGIF`]
3158 /// - [`IMG_LoadAnimation`]
3159 /// - [`IMG_LoadAnimation_IO`]
3160 /// - [`IMG_LoadAnimationTyped_IO`]
3161 /// - [`IMG_LoadANIAnimation_IO`]
3162 /// - [`IMG_LoadAPNGAnimation_IO`]
3163 /// - [`IMG_LoadAVIFAnimation_IO`]
3164 /// - [`IMG_LoadWEBPAnimation_IO`]
3165 /// - [`IMG_FreeAnimation`]
3166 pub fn IMG_LoadGIFAnimation_IO(src: *mut SDL_IOStream) -> *mut IMG_Animation;
3167}
3168
3169unsafe extern "C" {
3170 /// Load a WEBP animation directly.
3171 ///
3172 /// If you know you definitely have a WEBP image, you can call this function,
3173 /// which will skip SDL_image's file format detection routines. Generally it's
3174 /// better to use the abstract interfaces; also, there is only an [`SDL_IOStream`]
3175 /// interface available here.
3176 ///
3177 /// ## Parameters
3178 /// - `src`: an [`SDL_IOStream`] that data will be read from.
3179 ///
3180 /// ## Return value
3181 /// Returns a new [`IMG_Animation`], or NULL on error.
3182 ///
3183 /// ## Availability
3184 /// This function is available since SDL_image 3.0.0.
3185 ///
3186 /// ## See also
3187 /// - [`IMG_isWEBP`]
3188 /// - [`IMG_LoadAnimation`]
3189 /// - [`IMG_LoadAnimation_IO`]
3190 /// - [`IMG_LoadAnimationTyped_IO`]
3191 /// - [`IMG_LoadANIAnimation_IO`]
3192 /// - [`IMG_LoadAPNGAnimation_IO`]
3193 /// - [`IMG_LoadAVIFAnimation_IO`]
3194 /// - [`IMG_LoadGIFAnimation_IO`]
3195 /// - [`IMG_FreeAnimation`]
3196 pub fn IMG_LoadWEBPAnimation_IO(src: *mut SDL_IOStream) -> *mut IMG_Animation;
3197}
3198
3199unsafe extern "C" {
3200 /// Save an animation to a file.
3201 ///
3202 /// For formats that accept a quality, a default quality of 90 will be used.
3203 ///
3204 /// ## Parameters
3205 /// - `anim`: the animation to save.
3206 /// - `file`: path on the filesystem containing an animated image.
3207 ///
3208 /// ## Return value
3209 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3210 /// information.
3211 ///
3212 /// ## Availability
3213 /// This function is available since SDL_image 3.4.0.
3214 ///
3215 /// ## See also
3216 /// - [`IMG_SaveAnimationTyped_IO`]
3217 /// - [`IMG_SaveANIAnimation_IO`]
3218 /// - [`IMG_SaveAPNGAnimation_IO`]
3219 /// - [`IMG_SaveAVIFAnimation_IO`]
3220 /// - [`IMG_SaveGIFAnimation_IO`]
3221 /// - [`IMG_SaveWEBPAnimation_IO`]
3222 pub fn IMG_SaveAnimation(
3223 anim: *mut IMG_Animation,
3224 file: *const ::core::ffi::c_char,
3225 ) -> ::core::primitive::bool;
3226}
3227
3228unsafe extern "C" {
3229 /// Save an animation to an [`SDL_IOStream`].
3230 ///
3231 /// If you just want to save to a filename, you can use [`IMG_SaveAnimation()`]
3232 /// instead.
3233 ///
3234 /// If `closeio` is true, `dst` will be closed before returning, whether this
3235 /// function succeeds or not.
3236 ///
3237 /// For formats that accept a quality, a default quality of 90 will be used.
3238 ///
3239 /// ## Parameters
3240 /// - `anim`: the animation to save.
3241 /// - `dst`: an [`SDL_IOStream`] that data will be written to.
3242 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
3243 /// to leave it open.
3244 /// - `type`: a filename extension that represent this data ("GIF", etc).
3245 ///
3246 /// ## Return value
3247 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3248 /// information.
3249 ///
3250 /// ## Availability
3251 /// This function is available since SDL_image 3.4.0.
3252 ///
3253 /// ## See also
3254 /// - [`IMG_SaveAnimation`]
3255 /// - [`IMG_SaveANIAnimation_IO`]
3256 /// - [`IMG_SaveAPNGAnimation_IO`]
3257 /// - [`IMG_SaveAVIFAnimation_IO`]
3258 /// - [`IMG_SaveGIFAnimation_IO`]
3259 /// - [`IMG_SaveWEBPAnimation_IO`]
3260 pub fn IMG_SaveAnimationTyped_IO(
3261 anim: *mut IMG_Animation,
3262 dst: *mut SDL_IOStream,
3263 closeio: ::core::primitive::bool,
3264 r#type: *const ::core::ffi::c_char,
3265 ) -> ::core::primitive::bool;
3266}
3267
3268unsafe extern "C" {
3269 /// Save an animation in ANI format to an [`SDL_IOStream`].
3270 ///
3271 /// If `closeio` is true, `dst` will be closed before returning, whether this
3272 /// function succeeds or not.
3273 ///
3274 /// ## Parameters
3275 /// - `anim`: the animation to save.
3276 /// - `dst`: an [`SDL_IOStream`] from which data will be written to.
3277 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
3278 /// to leave it open.
3279 ///
3280 /// ## Return value
3281 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3282 /// information.
3283 ///
3284 /// ## Availability
3285 /// This function is available since SDL_image 3.4.0.
3286 ///
3287 /// ## See also
3288 /// - [`IMG_SaveAnimation`]
3289 /// - [`IMG_SaveAnimationTyped_IO`]
3290 /// - [`IMG_SaveAPNGAnimation_IO`]
3291 /// - [`IMG_SaveAVIFAnimation_IO`]
3292 /// - [`IMG_SaveGIFAnimation_IO`]
3293 /// - [`IMG_SaveWEBPAnimation_IO`]
3294 pub fn IMG_SaveANIAnimation_IO(
3295 anim: *mut IMG_Animation,
3296 dst: *mut SDL_IOStream,
3297 closeio: ::core::primitive::bool,
3298 ) -> ::core::primitive::bool;
3299}
3300
3301unsafe extern "C" {
3302 /// Save an animation in APNG format to an [`SDL_IOStream`].
3303 ///
3304 /// If `closeio` is true, `dst` will be closed before returning, whether this
3305 /// function succeeds or not.
3306 ///
3307 /// ## Parameters
3308 /// - `anim`: the animation to save.
3309 /// - `dst`: an [`SDL_IOStream`] from which data will be written to.
3310 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
3311 /// to leave it open.
3312 ///
3313 /// ## Return value
3314 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3315 /// information.
3316 ///
3317 /// ## Availability
3318 /// This function is available since SDL_image 3.4.0.
3319 ///
3320 /// ## See also
3321 /// - [`IMG_SaveAnimation`]
3322 /// - [`IMG_SaveAnimationTyped_IO`]
3323 /// - [`IMG_SaveANIAnimation_IO`]
3324 /// - [`IMG_SaveAVIFAnimation_IO`]
3325 /// - [`IMG_SaveGIFAnimation_IO`]
3326 /// - [`IMG_SaveWEBPAnimation_IO`]
3327 pub fn IMG_SaveAPNGAnimation_IO(
3328 anim: *mut IMG_Animation,
3329 dst: *mut SDL_IOStream,
3330 closeio: ::core::primitive::bool,
3331 ) -> ::core::primitive::bool;
3332}
3333
3334unsafe extern "C" {
3335 /// Save an animation in AVIF format to an [`SDL_IOStream`].
3336 ///
3337 /// If `closeio` is true, `dst` will be closed before returning, whether this
3338 /// function succeeds or not.
3339 ///
3340 /// ## Parameters
3341 /// - `anim`: the animation to save.
3342 /// - `dst`: an [`SDL_IOStream`] from which data will be written to.
3343 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
3344 /// to leave it open.
3345 /// - `quality`: the desired quality, ranging between 0 (lowest) and 100
3346 /// (highest).
3347 ///
3348 /// ## Return value
3349 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3350 /// information.
3351 ///
3352 /// ## Availability
3353 /// This function is available since SDL_image 3.4.0.
3354 ///
3355 /// ## See also
3356 /// - [`IMG_SaveAnimation`]
3357 /// - [`IMG_SaveAnimationTyped_IO`]
3358 /// - [`IMG_SaveANIAnimation_IO`]
3359 /// - [`IMG_SaveAPNGAnimation_IO`]
3360 /// - [`IMG_SaveGIFAnimation_IO`]
3361 /// - [`IMG_SaveWEBPAnimation_IO`]
3362 pub fn IMG_SaveAVIFAnimation_IO(
3363 anim: *mut IMG_Animation,
3364 dst: *mut SDL_IOStream,
3365 closeio: ::core::primitive::bool,
3366 quality: ::core::ffi::c_int,
3367 ) -> ::core::primitive::bool;
3368}
3369
3370unsafe extern "C" {
3371 /// Save an animation in GIF format to an [`SDL_IOStream`].
3372 ///
3373 /// If `closeio` is true, `dst` will be closed before returning, whether this
3374 /// function succeeds or not.
3375 ///
3376 /// ## Parameters
3377 /// - `anim`: the animation to save.
3378 /// - `dst`: an [`SDL_IOStream`] from which data will be written to.
3379 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
3380 /// to leave it open.
3381 ///
3382 /// ## Return value
3383 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3384 /// information.
3385 ///
3386 /// ## Availability
3387 /// This function is available since SDL_image 3.4.0.
3388 ///
3389 /// ## See also
3390 /// - [`IMG_SaveAnimation`]
3391 /// - [`IMG_SaveAnimationTyped_IO`]
3392 /// - [`IMG_SaveANIAnimation_IO`]
3393 /// - [`IMG_SaveAPNGAnimation_IO`]
3394 /// - [`IMG_SaveAVIFAnimation_IO`]
3395 /// - [`IMG_SaveWEBPAnimation_IO`]
3396 pub fn IMG_SaveGIFAnimation_IO(
3397 anim: *mut IMG_Animation,
3398 dst: *mut SDL_IOStream,
3399 closeio: ::core::primitive::bool,
3400 ) -> ::core::primitive::bool;
3401}
3402
3403unsafe extern "C" {
3404 /// Save an animation in WEBP format to an [`SDL_IOStream`].
3405 ///
3406 /// If `closeio` is true, `dst` will be closed before returning, whether this
3407 /// function succeeds or not.
3408 ///
3409 /// ## Parameters
3410 /// - `anim`: the animation to save.
3411 /// - `dst`: an [`SDL_IOStream`] from which data will be written to.
3412 /// - `closeio`: true to close/free the [`SDL_IOStream`] before returning, false
3413 /// to leave it open.
3414 /// - `quality`: between 0 and 100. For lossy, 0 gives the smallest size and
3415 /// 100 the largest. For lossless, this parameter is the amount
3416 /// of effort put into the compression: 0 is the fastest but
3417 /// gives larger files compared to the slowest, but best, 100.
3418 ///
3419 /// ## Return value
3420 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3421 /// information.
3422 ///
3423 /// ## Availability
3424 /// This function is available since SDL_image 3.4.0.
3425 ///
3426 /// ## See also
3427 /// - [`IMG_SaveAnimation`]
3428 /// - [`IMG_SaveAnimationTyped_IO`]
3429 /// - [`IMG_SaveANIAnimation_IO`]
3430 /// - [`IMG_SaveAPNGAnimation_IO`]
3431 /// - [`IMG_SaveAVIFAnimation_IO`]
3432 /// - [`IMG_SaveGIFAnimation_IO`]
3433 pub fn IMG_SaveWEBPAnimation_IO(
3434 anim: *mut IMG_Animation,
3435 dst: *mut SDL_IOStream,
3436 closeio: ::core::primitive::bool,
3437 quality: ::core::ffi::c_int,
3438 ) -> ::core::primitive::bool;
3439}
3440
3441unsafe extern "C" {
3442 /// Create an animated cursor from an animation.
3443 ///
3444 /// ## Parameters
3445 /// - `anim`: an animation to use to create an animated cursor.
3446 /// - `hot_x`: the x position of the cursor hot spot.
3447 /// - `hot_y`: the y position of the cursor hot spot.
3448 ///
3449 /// ## Return value
3450 /// Returns the new cursor on success or NULL on failure; call [`SDL_GetError()`]
3451 /// for more information.
3452 ///
3453 /// ## Availability
3454 /// This function is available since SDL_image 3.4.0.
3455 ///
3456 /// ## See also
3457 /// - [`IMG_LoadAnimation`]
3458 /// - [`IMG_LoadAnimation_IO`]
3459 /// - [`IMG_LoadAnimationTyped_IO`]
3460 pub fn IMG_CreateAnimatedCursor(
3461 anim: *mut IMG_Animation,
3462 hot_x: ::core::ffi::c_int,
3463 hot_y: ::core::ffi::c_int,
3464 ) -> *mut SDL_Cursor;
3465}
3466
3467unsafe extern "C" {
3468 /// Dispose of an [`IMG_Animation`] and free its resources.
3469 ///
3470 /// The provided `anim` pointer is not valid once this call returns.
3471 ///
3472 /// ## Parameters
3473 /// - `anim`: [`IMG_Animation`] to dispose of.
3474 ///
3475 /// ## Availability
3476 /// This function is available since SDL_image 3.0.0.
3477 ///
3478 /// ## See also
3479 /// - [`IMG_LoadAnimation`]
3480 /// - [`IMG_LoadAnimation_IO`]
3481 /// - [`IMG_LoadAnimationTyped_IO`]
3482 /// - [`IMG_LoadANIAnimation_IO`]
3483 /// - [`IMG_LoadAPNGAnimation_IO`]
3484 /// - [`IMG_LoadAVIFAnimation_IO`]
3485 /// - [`IMG_LoadGIFAnimation_IO`]
3486 /// - [`IMG_LoadWEBPAnimation_IO`]
3487 pub fn IMG_FreeAnimation(anim: *mut IMG_Animation);
3488}
3489
3490unsafe extern "C" {
3491 /// Create an encoder to save a series of images to a file.
3492 ///
3493 /// These animation types are currently supported:
3494 ///
3495 /// - ANI
3496 /// - APNG
3497 /// - AVIFS
3498 /// - GIF
3499 /// - WEBP
3500 ///
3501 /// The file type is determined from the file extension, e.g. "file.webp" will
3502 /// be encoded using WEBP.
3503 ///
3504 /// ## Parameters
3505 /// - `file`: the file where the animation will be saved.
3506 ///
3507 /// ## Return value
3508 /// Returns a new [`IMG_AnimationEncoder`], or NULL on failure; call
3509 /// [`SDL_GetError()`] for more information.
3510 ///
3511 /// ## Availability
3512 /// This function is available since SDL_image 3.4.0.
3513 ///
3514 /// ## See also
3515 /// - [`IMG_CreateAnimationEncoder_IO`]
3516 /// - [`IMG_CreateAnimationEncoderWithProperties`]
3517 /// - [`IMG_AddAnimationEncoderFrame`]
3518 /// - [`IMG_CloseAnimationEncoder`]
3519 pub fn IMG_CreateAnimationEncoder(
3520 file: *const ::core::ffi::c_char,
3521 ) -> *mut IMG_AnimationEncoder;
3522}
3523
3524unsafe extern "C" {
3525 /// Create an encoder to save a series of images to an IOStream.
3526 ///
3527 /// These animation types are currently supported:
3528 ///
3529 /// - ANI
3530 /// - APNG
3531 /// - AVIFS
3532 /// - GIF
3533 /// - WEBP
3534 ///
3535 /// If `closeio` is true, `dst` will be closed before returning if this
3536 /// function fails, or when the animation encoder is closed if this function
3537 /// succeeds.
3538 ///
3539 /// ## Parameters
3540 /// - `dst`: an [`SDL_IOStream`] that will be used to save the stream.
3541 /// - `closeio`: true to close the [`SDL_IOStream`] when done, false to leave it
3542 /// open.
3543 /// - `type`: a filename extension that represent this data ("WEBP", etc).
3544 ///
3545 /// ## Return value
3546 /// Returns a new [`IMG_AnimationEncoder`], or NULL on failure; call
3547 /// [`SDL_GetError()`] for more information.
3548 ///
3549 /// ## Availability
3550 /// This function is available since SDL_image 3.4.0.
3551 ///
3552 /// ## See also
3553 /// - [`IMG_CreateAnimationEncoder`]
3554 /// - [`IMG_CreateAnimationEncoderWithProperties`]
3555 /// - [`IMG_AddAnimationEncoderFrame`]
3556 /// - [`IMG_CloseAnimationEncoder`]
3557 pub fn IMG_CreateAnimationEncoder_IO(
3558 dst: *mut SDL_IOStream,
3559 closeio: ::core::primitive::bool,
3560 r#type: *const ::core::ffi::c_char,
3561 ) -> *mut IMG_AnimationEncoder;
3562}
3563
3564unsafe extern "C" {
3565 /// Create an animation encoder with the specified properties.
3566 ///
3567 /// These animation types are currently supported:
3568 ///
3569 /// - ANI
3570 /// - APNG
3571 /// - AVIFS
3572 /// - GIF
3573 /// - WEBP
3574 ///
3575 /// These are the supported properties:
3576 ///
3577 /// - [`IMG_PROP_ANIMATION_ENCODER_CREATE_FILENAME_STRING`]\: the file to save, if
3578 /// an [`SDL_IOStream`] isn't being used. This is required if
3579 /// [`IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_POINTER`] isn't set.
3580 /// - [`IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_POINTER`]\: an [`SDL_IOStream`]
3581 /// that will be used to save the stream. This should not be closed until the
3582 /// animation encoder is closed. This is required if
3583 /// [`IMG_PROP_ANIMATION_ENCODER_CREATE_FILENAME_STRING`] isn't set.
3584 /// - [`IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN`]\: true if
3585 /// closing the animation encoder should also close the associated
3586 /// [`SDL_IOStream`].
3587 /// - [`IMG_PROP_ANIMATION_ENCODER_CREATE_TYPE_STRING`]\: the output file type,
3588 /// e.g. "webp", defaults to the file extension if
3589 /// [`IMG_PROP_ANIMATION_ENCODER_CREATE_FILENAME_STRING`] is set.
3590 /// - [`IMG_PROP_ANIMATION_ENCODER_CREATE_QUALITY_NUMBER`]\: the compression
3591 /// quality, in the range of 0 to 100. The higher the number, the higher the
3592 /// quality and file size. This defaults to a balanced value for compression
3593 /// and quality.
3594 /// - [`IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_NUMERATOR_NUMBER`]\: the
3595 /// numerator of the fraction used to multiply the pts to convert it to
3596 /// seconds. This defaults to 1.
3597 /// - [`IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER`]\: the
3598 /// denominator of the fraction used to multiply the pts to convert it to
3599 /// seconds. This defaults to 1000.
3600 ///
3601 /// ## Parameters
3602 /// - `props`: the properties of the animation encoder.
3603 ///
3604 /// ## Return value
3605 /// Returns a new [`IMG_AnimationEncoder`], or NULL on failure; call
3606 /// [`SDL_GetError()`] for more information.
3607 ///
3608 /// ## Availability
3609 /// This function is available since SDL_image 3.4.0.
3610 ///
3611 /// ## See also
3612 /// - [`IMG_CreateAnimationEncoder`]
3613 /// - [`IMG_CreateAnimationEncoder_IO`]
3614 /// - [`IMG_AddAnimationEncoderFrame`]
3615 /// - [`IMG_CloseAnimationEncoder`]
3616 pub fn IMG_CreateAnimationEncoderWithProperties(
3617 props: SDL_PropertiesID,
3618 ) -> *mut IMG_AnimationEncoder;
3619}
3620
3621pub const IMG_PROP_ANIMATION_ENCODER_CREATE_FILENAME_STRING: *const ::core::ffi::c_char =
3622 c"SDL_image.animation_encoder.create.filename".as_ptr();
3623
3624pub const IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_POINTER: *const ::core::ffi::c_char =
3625 c"SDL_image.animation_encoder.create.iostream".as_ptr();
3626
3627pub const IMG_PROP_ANIMATION_ENCODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN: *const ::core::ffi::c_char =
3628 c"SDL_image.animation_encoder.create.iostream.autoclose".as_ptr();
3629
3630pub const IMG_PROP_ANIMATION_ENCODER_CREATE_TYPE_STRING: *const ::core::ffi::c_char =
3631 c"SDL_image.animation_encoder.create.type".as_ptr();
3632
3633pub const IMG_PROP_ANIMATION_ENCODER_CREATE_QUALITY_NUMBER: *const ::core::ffi::c_char =
3634 c"SDL_image.animation_encoder.create.quality".as_ptr();
3635
3636pub const IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_NUMERATOR_NUMBER: *const ::core::ffi::c_char =
3637 c"SDL_image.animation_encoder.create.timebase.numerator".as_ptr();
3638
3639pub const IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER:
3640 *const ::core::ffi::c_char =
3641 c"SDL_image.animation_encoder.create.timebase.denominator".as_ptr();
3642
3643pub const IMG_PROP_ANIMATION_ENCODER_CREATE_AVIF_MAX_THREADS_NUMBER: *const ::core::ffi::c_char =
3644 c"SDL_image.animation_encoder.create.avif.max_threads".as_ptr();
3645
3646pub const IMG_PROP_ANIMATION_ENCODER_CREATE_AVIF_KEYFRAME_INTERVAL_NUMBER:
3647 *const ::core::ffi::c_char =
3648 c"SDL_image.animation_encoder.create.avif.keyframe_interval".as_ptr();
3649
3650pub const IMG_PROP_ANIMATION_ENCODER_CREATE_GIF_USE_LUT_BOOLEAN: *const ::core::ffi::c_char =
3651 c"SDL_image.animation_encoder.create.gif.use_lut".as_ptr();
3652
3653unsafe extern "C" {
3654 /// Add a frame to an animation encoder.
3655 ///
3656 /// ## Parameters
3657 /// - `encoder`: the receiving images.
3658 /// - `surface`: the surface to add as the next frame in the animation.
3659 /// - `duration`: the duration of the frame, usually in milliseconds but can
3660 /// be other units if the
3661 /// [`IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER`]
3662 /// property is set when creating the encoder.
3663 ///
3664 /// ## Return value
3665 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3666 /// information.
3667 ///
3668 /// ## Availability
3669 /// This function is available since SDL_image 3.4.0.
3670 ///
3671 /// ## See also
3672 /// - [`IMG_CreateAnimationEncoder`]
3673 /// - [`IMG_CreateAnimationEncoder_IO`]
3674 /// - [`IMG_CreateAnimationEncoderWithProperties`]
3675 /// - [`IMG_CloseAnimationEncoder`]
3676 pub fn IMG_AddAnimationEncoderFrame(
3677 encoder: *mut IMG_AnimationEncoder,
3678 surface: *mut SDL_Surface,
3679 duration: Uint64,
3680 ) -> ::core::primitive::bool;
3681}
3682
3683unsafe extern "C" {
3684 /// Close an animation encoder, finishing any encoding.
3685 ///
3686 /// Calling this function frees the animation encoder, and returns the final
3687 /// status of the encoding process.
3688 ///
3689 /// ## Parameters
3690 /// - `encoder`: the encoder to close.
3691 ///
3692 /// ## Return value
3693 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
3694 /// information.
3695 ///
3696 /// ## Availability
3697 /// This function is available since SDL_image 3.4.0.
3698 ///
3699 /// ## See also
3700 /// - [`IMG_CreateAnimationEncoder`]
3701 /// - [`IMG_CreateAnimationEncoder_IO`]
3702 /// - [`IMG_CreateAnimationEncoderWithProperties`]
3703 pub fn IMG_CloseAnimationEncoder(encoder: *mut IMG_AnimationEncoder)
3704 -> ::core::primitive::bool;
3705}
3706
3707/// An enum representing the status of an animation decoder.
3708///
3709/// ## Availability
3710/// This enum is available since SDL_image 3.4.0.
3711///
3712/// ## Known values (`sdl3-sys`)
3713/// | Associated constant | Global constant | Description |
3714/// | ------------------- | --------------- | ----------- |
3715/// | [`INVALID`](IMG_AnimationDecoderStatus::INVALID) | [`IMG_DECODER_STATUS_INVALID`] | The decoder is invalid |
3716/// | [`OK`](IMG_AnimationDecoderStatus::OK) | [`IMG_DECODER_STATUS_OK`] | The decoder is ready to decode the next frame |
3717/// | [`FAILED`](IMG_AnimationDecoderStatus::FAILED) | [`IMG_DECODER_STATUS_FAILED`] | The decoder failed to decode a frame, call [`SDL_GetError()`] for more information. |
3718/// | [`COMPLETE`](IMG_AnimationDecoderStatus::COMPLETE) | [`IMG_DECODER_STATUS_COMPLETE`] | No more frames available |
3719#[repr(transparent)]
3720#[derive(Clone, Copy, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
3721pub struct IMG_AnimationDecoderStatus(pub ::core::ffi::c_int);
3722
3723impl ::core::cmp::PartialEq<::core::ffi::c_int> for IMG_AnimationDecoderStatus {
3724 #[inline(always)]
3725 fn eq(&self, other: &::core::ffi::c_int) -> bool {
3726 &self.0 == other
3727 }
3728}
3729
3730impl ::core::cmp::PartialEq<IMG_AnimationDecoderStatus> for ::core::ffi::c_int {
3731 #[inline(always)]
3732 fn eq(&self, other: &IMG_AnimationDecoderStatus) -> bool {
3733 self == &other.0
3734 }
3735}
3736
3737impl From<IMG_AnimationDecoderStatus> for ::core::ffi::c_int {
3738 #[inline(always)]
3739 fn from(value: IMG_AnimationDecoderStatus) -> Self {
3740 value.0
3741 }
3742}
3743
3744#[cfg(feature = "debug-impls")]
3745impl ::core::fmt::Debug for IMG_AnimationDecoderStatus {
3746 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
3747 #[allow(unreachable_patterns)]
3748 f.write_str(match *self {
3749 Self::INVALID => "IMG_DECODER_STATUS_INVALID",
3750 Self::OK => "IMG_DECODER_STATUS_OK",
3751 Self::FAILED => "IMG_DECODER_STATUS_FAILED",
3752 Self::COMPLETE => "IMG_DECODER_STATUS_COMPLETE",
3753
3754 _ => return write!(f, "IMG_AnimationDecoderStatus({})", self.0),
3755 })
3756 }
3757}
3758
3759impl IMG_AnimationDecoderStatus {
3760 /// The decoder is invalid
3761 pub const INVALID: Self = Self((-1_i32 as ::core::ffi::c_int));
3762 /// The decoder is ready to decode the next frame
3763 pub const OK: Self = Self((0_i32 as ::core::ffi::c_int));
3764 /// The decoder failed to decode a frame, call [`SDL_GetError()`] for more information.
3765 pub const FAILED: Self = Self((1_i32 as ::core::ffi::c_int));
3766 /// No more frames available
3767 pub const COMPLETE: Self = Self((2_i32 as ::core::ffi::c_int));
3768}
3769
3770/// The decoder is invalid
3771pub const IMG_DECODER_STATUS_INVALID: IMG_AnimationDecoderStatus =
3772 IMG_AnimationDecoderStatus::INVALID;
3773/// The decoder is ready to decode the next frame
3774pub const IMG_DECODER_STATUS_OK: IMG_AnimationDecoderStatus = IMG_AnimationDecoderStatus::OK;
3775/// The decoder failed to decode a frame, call [`SDL_GetError()`] for more information.
3776pub const IMG_DECODER_STATUS_FAILED: IMG_AnimationDecoderStatus =
3777 IMG_AnimationDecoderStatus::FAILED;
3778/// No more frames available
3779pub const IMG_DECODER_STATUS_COMPLETE: IMG_AnimationDecoderStatus =
3780 IMG_AnimationDecoderStatus::COMPLETE;
3781
3782#[cfg(feature = "metadata")]
3783impl sdl3_sys::metadata::GroupMetadata for IMG_AnimationDecoderStatus {
3784 const GROUP_METADATA: &'static sdl3_sys::metadata::Group =
3785 &crate::metadata::image::METADATA_IMG_AnimationDecoderStatus;
3786}
3787
3788unsafe extern "C" {
3789 /// Create a decoder to read a series of images from a file.
3790 ///
3791 /// These animation types are currently supported:
3792 ///
3793 /// - ANI
3794 /// - APNG
3795 /// - AVIFS
3796 /// - GIF
3797 /// - WEBP
3798 ///
3799 /// The file type is determined from the file extension, e.g. "file.webp" will
3800 /// be decoded using WEBP.
3801 ///
3802 /// ## Parameters
3803 /// - `file`: the file containing a series of images.
3804 ///
3805 /// ## Return value
3806 /// Returns a new [`IMG_AnimationDecoder`], or NULL on failure; call
3807 /// [`SDL_GetError()`] for more information.
3808 ///
3809 /// ## Availability
3810 /// This function is available since SDL_image 3.4.0.
3811 ///
3812 /// ## See also
3813 /// - [`IMG_CreateAnimationDecoder_IO`]
3814 /// - [`IMG_CreateAnimationDecoderWithProperties`]
3815 /// - [`IMG_GetAnimationDecoderFrame`]
3816 /// - [`IMG_ResetAnimationDecoder`]
3817 /// - [`IMG_CloseAnimationDecoder`]
3818 pub fn IMG_CreateAnimationDecoder(
3819 file: *const ::core::ffi::c_char,
3820 ) -> *mut IMG_AnimationDecoder;
3821}
3822
3823unsafe extern "C" {
3824 /// Create a decoder to read a series of images from an IOStream.
3825 ///
3826 /// These animation types are currently supported:
3827 ///
3828 /// - ANI
3829 /// - APNG
3830 /// - AVIFS
3831 /// - GIF
3832 /// - WEBP
3833 ///
3834 /// If `closeio` is true, `src` will be closed before returning if this
3835 /// function fails, or when the animation decoder is closed if this function
3836 /// succeeds.
3837 ///
3838 /// ## Parameters
3839 /// - `src`: an [`SDL_IOStream`] containing a series of images.
3840 /// - `closeio`: true to close the [`SDL_IOStream`] when done, false to leave it
3841 /// open.
3842 /// - `type`: a filename extension that represent this data ("WEBP", etc).
3843 ///
3844 /// ## Return value
3845 /// Returns a new [`IMG_AnimationDecoder`], or NULL on failure; call
3846 /// [`SDL_GetError()`] for more information.
3847 ///
3848 /// ## Availability
3849 /// This function is available since SDL_image 3.4.0.
3850 ///
3851 /// ## See also
3852 /// - [`IMG_CreateAnimationDecoder`]
3853 /// - [`IMG_CreateAnimationDecoderWithProperties`]
3854 /// - [`IMG_GetAnimationDecoderFrame`]
3855 /// - [`IMG_ResetAnimationDecoder`]
3856 /// - [`IMG_CloseAnimationDecoder`]
3857 pub fn IMG_CreateAnimationDecoder_IO(
3858 src: *mut SDL_IOStream,
3859 closeio: ::core::primitive::bool,
3860 r#type: *const ::core::ffi::c_char,
3861 ) -> *mut IMG_AnimationDecoder;
3862}
3863
3864unsafe extern "C" {
3865 /// Create an animation decoder with the specified properties.
3866 ///
3867 /// These animation types are currently supported:
3868 ///
3869 /// - ANI
3870 /// - APNG
3871 /// - AVIFS
3872 /// - GIF
3873 /// - WEBP
3874 ///
3875 /// These are the supported properties:
3876 ///
3877 /// - [`IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING`]\: the file to load, if
3878 /// an [`SDL_IOStream`] isn't being used. This is required if
3879 /// [`IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_POINTER`] isn't set.
3880 /// - [`IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_POINTER`]\: an [`SDL_IOStream`]
3881 /// containing a series of images. This should not be closed until the
3882 /// animation decoder is closed. This is required if
3883 /// [`IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING`] isn't set.
3884 /// - [`IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN`]\: true if
3885 /// closing the animation decoder should also close the associated
3886 /// [`SDL_IOStream`].
3887 /// - [`IMG_PROP_ANIMATION_DECODER_CREATE_TYPE_STRING`]\: the input file type,
3888 /// e.g. "webp", defaults to the file extension if
3889 /// [`IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING`] is set.
3890 ///
3891 /// ## Parameters
3892 /// - `props`: the properties of the animation decoder.
3893 ///
3894 /// ## Return value
3895 /// Returns a new [`IMG_AnimationDecoder`], or NULL on failure; call
3896 /// [`SDL_GetError()`] for more information.
3897 ///
3898 /// ## Availability
3899 /// This function is available since SDL_image 3.4.0.
3900 ///
3901 /// ## See also
3902 /// - [`IMG_CreateAnimationDecoder`]
3903 /// - [`IMG_CreateAnimationDecoder_IO`]
3904 /// - [`IMG_GetAnimationDecoderFrame`]
3905 /// - [`IMG_ResetAnimationDecoder`]
3906 /// - [`IMG_CloseAnimationDecoder`]
3907 pub fn IMG_CreateAnimationDecoderWithProperties(
3908 props: SDL_PropertiesID,
3909 ) -> *mut IMG_AnimationDecoder;
3910}
3911
3912pub const IMG_PROP_ANIMATION_DECODER_CREATE_FILENAME_STRING: *const ::core::ffi::c_char =
3913 c"SDL_image.animation_decoder.create.filename".as_ptr();
3914
3915pub const IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_POINTER: *const ::core::ffi::c_char =
3916 c"SDL_image.animation_decoder.create.iostream".as_ptr();
3917
3918pub const IMG_PROP_ANIMATION_DECODER_CREATE_IOSTREAM_AUTOCLOSE_BOOLEAN: *const ::core::ffi::c_char =
3919 c"SDL_image.animation_decoder.create.iostream.autoclose".as_ptr();
3920
3921pub const IMG_PROP_ANIMATION_DECODER_CREATE_TYPE_STRING: *const ::core::ffi::c_char =
3922 c"SDL_image.animation_decoder.create.type".as_ptr();
3923
3924pub const IMG_PROP_ANIMATION_DECODER_CREATE_TIMEBASE_NUMERATOR_NUMBER: *const ::core::ffi::c_char =
3925 c"SDL_image.animation_decoder.create.timebase.numerator".as_ptr();
3926
3927pub const IMG_PROP_ANIMATION_DECODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER:
3928 *const ::core::ffi::c_char =
3929 c"SDL_image.animation_decoder.create.timebase.denominator".as_ptr();
3930
3931pub const IMG_PROP_ANIMATION_DECODER_CREATE_AVIF_MAX_THREADS_NUMBER: *const ::core::ffi::c_char =
3932 c"SDL_image.animation_decoder.create.avif.max_threads".as_ptr();
3933
3934pub const IMG_PROP_ANIMATION_DECODER_CREATE_AVIF_ALLOW_INCREMENTAL_BOOLEAN:
3935 *const ::core::ffi::c_char =
3936 c"SDL_image.animation_decoder.create.avif.allow_incremental".as_ptr();
3937
3938pub const IMG_PROP_ANIMATION_DECODER_CREATE_AVIF_ALLOW_PROGRESSIVE_BOOLEAN:
3939 *const ::core::ffi::c_char =
3940 c"SDL_image.animation_decoder.create.avif.allow_progressive".as_ptr();
3941
3942pub const IMG_PROP_ANIMATION_DECODER_CREATE_GIF_TRANSPARENT_COLOR_INDEX_NUMBER:
3943 *const ::core::ffi::c_char =
3944 c"SDL_image.animation_encoder.create.gif.transparent_color_index".as_ptr();
3945
3946pub const IMG_PROP_ANIMATION_DECODER_CREATE_GIF_NUM_COLORS_NUMBER: *const ::core::ffi::c_char =
3947 c"SDL_image.animation_encoder.create.gif.num_colors".as_ptr();
3948
3949unsafe extern "C" {
3950 /// Get the properties of an animation decoder.
3951 ///
3952 /// This function returns the properties of the animation decoder, which holds
3953 /// information about the underlying image such as description, copyright text
3954 /// and loop count.
3955 ///
3956 /// ## Parameters
3957 /// - `decoder`: the animation decoder.
3958 ///
3959 /// ## Return value
3960 /// Returns the properties ID of the animation decoder, or 0 if there are no
3961 /// properties; call [`SDL_GetError()`] for more information.
3962 ///
3963 /// ## Availability
3964 /// This function is available since SDL_image 3.4.0.
3965 ///
3966 /// ## See also
3967 /// - [`IMG_CreateAnimationDecoder`]
3968 /// - [`IMG_CreateAnimationDecoder_IO`]
3969 /// - [`IMG_CreateAnimationDecoderWithProperties`]
3970 pub fn IMG_GetAnimationDecoderProperties(
3971 decoder: *mut IMG_AnimationDecoder,
3972 ) -> SDL_PropertiesID;
3973}
3974
3975pub const IMG_PROP_METADATA_IGNORE_PROPS_BOOLEAN: *const ::core::ffi::c_char =
3976 c"SDL_image.metadata.ignore_props".as_ptr();
3977
3978pub const IMG_PROP_METADATA_DESCRIPTION_STRING: *const ::core::ffi::c_char =
3979 c"SDL_image.metadata.description".as_ptr();
3980
3981pub const IMG_PROP_METADATA_COPYRIGHT_STRING: *const ::core::ffi::c_char =
3982 c"SDL_image.metadata.copyright".as_ptr();
3983
3984pub const IMG_PROP_METADATA_TITLE_STRING: *const ::core::ffi::c_char =
3985 c"SDL_image.metadata.title".as_ptr();
3986
3987pub const IMG_PROP_METADATA_AUTHOR_STRING: *const ::core::ffi::c_char =
3988 c"SDL_image.metadata.author".as_ptr();
3989
3990pub const IMG_PROP_METADATA_CREATION_TIME_STRING: *const ::core::ffi::c_char =
3991 c"SDL_image.metadata.creation_time".as_ptr();
3992
3993pub const IMG_PROP_METADATA_FRAME_COUNT_NUMBER: *const ::core::ffi::c_char =
3994 c"SDL_image.metadata.frame_count".as_ptr();
3995
3996pub const IMG_PROP_METADATA_LOOP_COUNT_NUMBER: *const ::core::ffi::c_char =
3997 c"SDL_image.metadata.loop_count".as_ptr();
3998
3999unsafe extern "C" {
4000 /// Get the next frame in an animation decoder.
4001 ///
4002 /// This function decodes the next frame in the animation decoder, returning it
4003 /// as an [`SDL_Surface`]. The returned surface should be freed with
4004 /// [`SDL_FreeSurface()`] when no longer needed.
4005 ///
4006 /// If the animation decoder has no more frames or an error occurred while
4007 /// decoding the frame, this function returns false. In that case, please call
4008 /// [`SDL_GetError()`] for more information. If [`SDL_GetError()`] returns an empty
4009 /// string, that means there are no more available frames. If [`SDL_GetError()`]
4010 /// returns a valid string, that means the decoding failed.
4011 ///
4012 /// ## Parameters
4013 /// - `decoder`: the animation decoder.
4014 /// - `frame`: a pointer filled in with the [`SDL_Surface`] for the next frame in
4015 /// the animation.
4016 /// - `duration`: the duration of the frame, usually in milliseconds but can
4017 /// be other units if the
4018 /// [`IMG_PROP_ANIMATION_DECODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER`]
4019 /// property is set when creating the decoder.
4020 ///
4021 /// ## Return value
4022 /// Returns true on success or false on failure and when no more frames are
4023 /// available; call [`IMG_GetAnimationDecoderStatus()`] or [`SDL_GetError()`]
4024 /// for more information.
4025 ///
4026 /// ## Availability
4027 /// This function is available since SDL_image 3.4.0.
4028 ///
4029 /// ## See also
4030 /// - [`IMG_CreateAnimationDecoder`]
4031 /// - [`IMG_CreateAnimationDecoder_IO`]
4032 /// - [`IMG_CreateAnimationDecoderWithProperties`]
4033 /// - [`IMG_GetAnimationDecoderStatus`]
4034 /// - [`IMG_ResetAnimationDecoder`]
4035 /// - [`IMG_CloseAnimationDecoder`]
4036 pub fn IMG_GetAnimationDecoderFrame(
4037 decoder: *mut IMG_AnimationDecoder,
4038 frame: *mut *mut SDL_Surface,
4039 duration: *mut Uint64,
4040 ) -> ::core::primitive::bool;
4041}
4042
4043unsafe extern "C" {
4044 /// Get the decoder status indicating the current state of the decoder.
4045 ///
4046 /// ## Parameters
4047 /// - `decoder`: the decoder to get the status of.
4048 ///
4049 /// ## Return value
4050 /// Returns the status of the underlying decoder, or
4051 /// [`IMG_DECODER_STATUS_INVALID`] if the given decoder is invalid.
4052 ///
4053 /// ## Availability
4054 /// This function is available since SDL_image 3.4.0.
4055 ///
4056 /// ## See also
4057 /// - [`IMG_GetAnimationDecoderFrame`]
4058 pub fn IMG_GetAnimationDecoderStatus(
4059 decoder: *mut IMG_AnimationDecoder,
4060 ) -> IMG_AnimationDecoderStatus;
4061}
4062
4063unsafe extern "C" {
4064 /// Reset an animation decoder.
4065 ///
4066 /// Calling this function resets the animation decoder, allowing it to start
4067 /// from the beginning again. This is useful if you want to decode the frame
4068 /// sequence again without creating a new decoder.
4069 ///
4070 /// ## Parameters
4071 /// - `decoder`: the decoder to reset.
4072 ///
4073 /// ## Return value
4074 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
4075 /// information.
4076 ///
4077 /// ## Availability
4078 /// This function is available since SDL_image 3.4.0.
4079 ///
4080 /// ## See also
4081 /// - [`IMG_CreateAnimationDecoder`]
4082 /// - [`IMG_CreateAnimationDecoder_IO`]
4083 /// - [`IMG_CreateAnimationDecoderWithProperties`]
4084 /// - [`IMG_GetAnimationDecoderFrame`]
4085 /// - [`IMG_CloseAnimationDecoder`]
4086 pub fn IMG_ResetAnimationDecoder(decoder: *mut IMG_AnimationDecoder)
4087 -> ::core::primitive::bool;
4088}
4089
4090unsafe extern "C" {
4091 /// Close an animation decoder, finishing any decoding.
4092 ///
4093 /// Calling this function frees the animation decoder, and returns the final
4094 /// status of the decoding process.
4095 ///
4096 /// ## Parameters
4097 /// - `decoder`: the decoder to close.
4098 ///
4099 /// ## Return value
4100 /// Returns true on success or false on failure; call [`SDL_GetError()`] for more
4101 /// information.
4102 ///
4103 /// ## Availability
4104 /// This function is available since SDL_image 3.4.0.
4105 ///
4106 /// ## See also
4107 /// - [`IMG_CreateAnimationDecoder`]
4108 /// - [`IMG_CreateAnimationDecoder_IO`]
4109 /// - [`IMG_CreateAnimationDecoderWithProperties`]
4110 pub fn IMG_CloseAnimationDecoder(decoder: *mut IMG_AnimationDecoder)
4111 -> ::core::primitive::bool;
4112}
4113
4114/// * An object representing animation decoder.
4115#[repr(C)]
4116pub struct IMG_AnimationDecoder {
4117 _opaque: [::core::primitive::u8; 0],
4118}
4119
4120/// * An object representing the encoder context.
4121#[repr(C)]
4122pub struct IMG_AnimationEncoder {
4123 _opaque: [::core::primitive::u8; 0],
4124}
4125
4126#[cfg(doc)]
4127use crate::everything::*;