SDL 3.0
SDL_surface.h
Go to the documentation of this file.
1/*
2 Simple DirectMedia Layer
3 Copyright (C) 1997-2024 Sam Lantinga <slouken@libsdl.org>
4
5 This software is provided 'as-is', without any express or implied
6 warranty. In no event will the authors be held liable for any damages
7 arising from the use of this software.
8
9 Permission is granted to anyone to use this software for any purpose,
10 including commercial applications, and to alter it and redistribute it
11 freely, subject to the following restrictions:
12
13 1. The origin of this software must not be misrepresented; you must not
14 claim that you wrote the original software. If you use this software
15 in a product, an acknowledgment in the product documentation would be
16 appreciated but is not required.
17 2. Altered source versions must be plainly marked as such, and must not be
18 misrepresented as being the original software.
19 3. This notice may not be removed or altered from any source distribution.
20*/
21
22/**
23 * \file SDL_surface.h
24 *
25 * Header file for ::SDL_Surface definition and management functions.
26 */
27
28#ifndef SDL_surface_h_
29#define SDL_surface_h_
30
31#include <SDL3/SDL_stdinc.h>
32#include <SDL3/SDL_blendmode.h>
33#include <SDL3/SDL_pixels.h>
34#include <SDL3/SDL_properties.h>
35#include <SDL3/SDL_rect.h>
36#include <SDL3/SDL_rwops.h>
37
38#include <SDL3/SDL_begin_code.h>
39/* Set up for C function definitions, even when using C++ */
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44/**
45 * \name Surface flags
46 *
47 * These are the currently supported flags for the ::SDL_Surface.
48 *
49 * \internal
50 * Used internally (read-only).
51 */
52/* @{ */
53#define SDL_SWSURFACE 0 /**< Just here for compatibility */
54#define SDL_PREALLOC 0x00000001 /**< Surface uses preallocated memory */
55#define SDL_RLEACCEL 0x00000002 /**< Surface is RLE encoded */
56#define SDL_DONTFREE 0x00000004 /**< Surface is referenced internally */
57#define SDL_SIMD_ALIGNED 0x00000008 /**< Surface uses aligned memory */
58#define SDL_SURFACE_USES_PROPERTIES 0x00000010 /**< Surface uses properties */
59/* @} *//* Surface flags */
60
61/**
62 * Evaluates to true if the surface needs to be locked before access.
63 */
64#define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
65
66typedef struct SDL_BlitMap SDL_BlitMap; /* this is an opaque type. */
67
68/**
69 * The scaling mode
70 */
71typedef enum
72{
73 SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
74 SDL_SCALEMODE_LINEAR, /**< linear filtering */
75 SDL_SCALEMODE_BEST /**< anisotropic filtering */
77
78/**
79 * The flip mode
80 */
81typedef enum
82{
83 SDL_FLIP_NONE, /**< Do not flip */
84 SDL_FLIP_HORIZONTAL, /**< flip horizontally */
85 SDL_FLIP_VERTICAL /**< flip vertically */
87
88/**
89 * A collection of pixels used in software blitting.
90 *
91 * Pixels are arranged in memory in rows, with the top row first.
92 * Each row occupies an amount of memory given by the pitch (sometimes
93 * known as the row stride in non-SDL APIs).
94 *
95 * Within each row, pixels are arranged from left to right until the
96 * width is reached.
97 * Each pixel occupies a number of bits appropriate for its format, with
98 * most formats representing each pixel as one or more whole bytes
99 * (in some indexed formats, instead multiple pixels are packed into
100 * each byte), and a byte order given by the format.
101 * After encoding all pixels, any remaining bytes to reach the pitch are
102 * used as padding to reach a desired alignment, and have undefined contents.
103 *
104 * \note This structure should be treated as read-only, except for \c pixels,
105 * which, if not NULL, contains the raw pixel data for the surface.
106 * \sa SDL_CreateSurfaceFrom
107 */
108typedef struct SDL_Surface
109{
110 Uint32 flags; /**< Read-only */
111 SDL_PixelFormat *format; /**< Read-only */
112 int w, h; /**< Read-only */
113 int pitch; /**< Read-only */
114 void *pixels; /**< Read-write */
115
116 void *reserved; /**< Private */
117
118 /** information needed for surfaces requiring locks */
119 int locked; /**< Read-only */
120
121 /** list of BlitMap that hold a reference to this surface */
122 void *list_blitmap; /**< Private */
123
124 /** clipping information */
125 SDL_Rect clip_rect; /**< Read-only */
126
127 /** info for fast blit mapping to other surfaces */
128 SDL_BlitMap *map; /**< Private */
129
130 /** Reference count -- used when freeing surface */
131 int refcount; /**< Read-mostly */
133
134/**
135 * The type of function used for surface blitting functions.
136 */
137typedef int (SDLCALL *SDL_blit) (struct SDL_Surface *src, const SDL_Rect *srcrect,
138 struct SDL_Surface *dst, const SDL_Rect *dstrect);
139
140
141/**
142 * The color primaries, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
143 */
161
162/**
163 * The transfer characteristics, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en
164 */
186
187/**
188 * The formula used for converting between YUV and RGB
189 */
190typedef enum
191{
192 SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */
193 SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */
195 SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */
197
198/**
199 * Allocate a new RGB surface with a specific pixel format.
200 *
201 * \param width the width of the surface
202 * \param height the height of the surface
203 * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
204 * \returns the new SDL_Surface structure that is created or NULL if it fails;
205 * call SDL_GetError() for more information.
206 *
207 * \since This function is available since SDL 3.0.0.
208 *
209 * \sa SDL_CreateSurfaceFrom
210 * \sa SDL_DestroySurface
211 */
212extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurface
213 (int width, int height, Uint32 format);
214
215/**
216 * Allocate a new RGB surface with a specific pixel format and existing pixel
217 * data.
218 *
219 * No copy is made of the pixel data. Pixel data is not managed automatically;
220 * you must free the surface before you free the pixel data.
221 *
222 * Pitch is the offset in bytes from one row of pixels to the next, e.g.
223 * `width*4` for `SDL_PIXELFORMAT_RGBA8888`.
224 *
225 * You may pass NULL for pixels and 0 for pitch to create a surface that you
226 * will fill in with valid values later.
227 *
228 * \param pixels a pointer to existing pixel data
229 * \param width the width of the surface
230 * \param height the height of the surface
231 * \param pitch the pitch of the surface in bytes
232 * \param format the SDL_PixelFormatEnum for the new surface's pixel format.
233 * \returns the new SDL_Surface structure that is created or NULL if it fails;
234 * call SDL_GetError() for more information.
235 *
236 * \since This function is available since SDL 3.0.0.
237 *
238 * \sa SDL_CreateSurface
239 * \sa SDL_DestroySurface
240 */
241extern DECLSPEC SDL_Surface *SDLCALL SDL_CreateSurfaceFrom
242 (void *pixels, int width, int height, int pitch, Uint32 format);
243
244/**
245 * Free an RGB surface.
246 *
247 * It is safe to pass NULL to this function.
248 *
249 * \param surface the SDL_Surface to free.
250 *
251 * \since This function is available since SDL 3.0.0.
252 *
253 * \sa SDL_CreateSurface
254 * \sa SDL_CreateSurfaceFrom
255 * \sa SDL_LoadBMP
256 * \sa SDL_LoadBMP_RW
257 */
258extern DECLSPEC void SDLCALL SDL_DestroySurface(SDL_Surface *surface);
259
260/**
261 * Get the properties associated with a surface.
262 *
263 * The following properties are understood by SDL:
264 *
265 * - `SDL_PROPERTY_SURFACE_COLOR_PRIMARIES_NUMBER`: an SDL_ColorPrimaries
266 * value describing the surface colorspace
267 * - `SDL_PROPERTY_SURFACE_TRANSFER_CHARACTERISTICS_NUMBER`: an
268 * SDL_TransferCharacteristics value describing the surface colorspace
269 * - `SDL_PROPERTY_SURFACE_MAXCLL_NUMBER`: MaxCLL (Maximum Content Light
270 * Level) indicates the maximum light level of any single pixel (in cd/m2 or
271 * nits) of the entire playback sequence. MaxCLL is usually measured off the
272 * final delivered content after mastering. If one uses the full light level
273 * of the HDR mastering display and adds a hard clip at its maximum value,
274 * MaxCLL would be equal to the peak luminance of the mastering monitor.
275 * - `SDL_PROPERTY_SURFACE_MAXFALL_NUMBER`: MaxFALL (Maximum Frame Average
276 * Light Level) indicates the maximum value of the frame average light level
277 * (in cd/m2 or nits) of the entire playback sequence. MaxFALL is calculated
278 * by averaging the decoded luminance values of all the pixels within a
279 * frame. MaxFALL is usually much lower than MaxCLL.
280 *
281 * \param surface the SDL_Surface structure to query
282 * \returns a valid property ID on success or 0 on failure; call
283 * SDL_GetError() for more information.
284 *
285 * \since This function is available since SDL 3.0.0.
286 *
287 * \sa SDL_GetProperty
288 * \sa SDL_SetProperty
289 */
290extern DECLSPEC SDL_PropertiesID SDLCALL SDL_GetSurfaceProperties(SDL_Surface *surface);
291
292#define SDL_PROPERTY_SURFACE_COLOR_PRIMARIES_NUMBER "SDL.surface.color_primaries"
293#define SDL_PROPERTY_SURFACE_TRANSFER_CHARACTERISTICS_NUMBER "SDL.surface.transfer_characteristics"
294#define SDL_PROPERTY_SURFACE_MAXCLL_NUMBER "SDL.surface.maxCLL"
295#define SDL_PROPERTY_SURFACE_MAXFALL_NUMBER "SDL.surface.maxFALL"
296
297/**
298 * Set the palette used by a surface.
299 *
300 * A single palette can be shared with many surfaces.
301 *
302 * \param surface the SDL_Surface structure to update
303 * \param palette the SDL_Palette structure to use
304 * \returns 0 on success or a negative error code on failure; call
305 * SDL_GetError() for more information.
306 *
307 * \since This function is available since SDL 3.0.0.
308 */
309extern DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface,
310 SDL_Palette *palette);
311
312/**
313 * Set up a surface for directly accessing the pixels.
314 *
315 * Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write to
316 * and read from `surface->pixels`, using the pixel format stored in
317 * `surface->format`. Once you are done accessing the surface, you should use
318 * SDL_UnlockSurface() to release it.
319 *
320 * Not all surfaces require locking. If `SDL_MUSTLOCK(surface)` evaluates to
321 * 0, then you can read and write to the surface at any time, and the pixel
322 * format of the surface will not change.
323 *
324 * \param surface the SDL_Surface structure to be locked
325 * \returns 0 on success or a negative error code on failure; call
326 * SDL_GetError() for more information.
327 *
328 * \since This function is available since SDL 3.0.0.
329 *
330 * \sa SDL_MUSTLOCK
331 * \sa SDL_UnlockSurface
332 */
333extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface);
334
335/**
336 * Release a surface after directly accessing the pixels.
337 *
338 * \param surface the SDL_Surface structure to be unlocked
339 *
340 * \since This function is available since SDL 3.0.0.
341 *
342 * \sa SDL_LockSurface
343 */
344extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface);
345
346/**
347 * Load a BMP image from a seekable SDL data stream.
348 *
349 * The new surface should be freed with SDL_DestroySurface(). Not doing so
350 * will result in a memory leak.
351 *
352 * \param src the data stream for the surface
353 * \param freesrc if SDL_TRUE, calls SDL_RWclose() on `src` before returning,
354 * even in the case of an error
355 * \returns a pointer to a new SDL_Surface structure or NULL if there was an
356 * error; call SDL_GetError() for more information.
357 *
358 * \since This function is available since SDL 3.0.0.
359 *
360 * \sa SDL_DestroySurface
361 * \sa SDL_LoadBMP
362 * \sa SDL_SaveBMP_RW
363 */
364extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, SDL_bool freesrc);
365
366/**
367 * Load a BMP image from a file.
368 *
369 * The new surface should be freed with SDL_DestroySurface(). Not doing so
370 * will result in a memory leak.
371 *
372 * \param file the BMP file to load
373 * \returns a pointer to a new SDL_Surface structure or NULL if there was an
374 * error; call SDL_GetError() for more information.
375 *
376 * \since This function is available since SDL 3.0.0.
377 *
378 * \sa SDL_DestroySurface
379 * \sa SDL_LoadBMP_RW
380 * \sa SDL_SaveBMP
381 */
382extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP(const char *file);
383
384/**
385 * Save a surface to a seekable SDL data stream in BMP format.
386 *
387 * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
388 * BMP directly. Other RGB formats with 8-bit or higher get converted to a
389 * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
390 * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
391 * not supported.
392 *
393 * \param surface the SDL_Surface structure containing the image to be saved
394 * \param dst a data stream to save to
395 * \param freedst if SDL_TRUE, calls SDL_RWclose() on `dst` before returning,
396 * even in the case of an error
397 * \returns 0 on success or a negative error code on failure; call
398 * SDL_GetError() for more information.
399 *
400 * \since This function is available since SDL 3.0.0.
401 *
402 * \sa SDL_LoadBMP_RW
403 * \sa SDL_SaveBMP
404 */
405extern DECLSPEC int SDLCALL SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, SDL_bool freedst);
406
407/**
408 * Save a surface to a file.
409 *
410 * Surfaces with a 24-bit, 32-bit and paletted 8-bit format get saved in the
411 * BMP directly. Other RGB formats with 8-bit or higher get converted to a
412 * 24-bit surface or, if they have an alpha mask or a colorkey, to a 32-bit
413 * surface before they are saved. YUV and paletted 1-bit and 4-bit formats are
414 * not supported.
415 *
416 * \param surface the SDL_Surface structure containing the image to be saved
417 * \param file a file to save to
418 * \returns 0 on success or a negative error code on failure; call
419 * SDL_GetError() for more information.
420 *
421 * \since This function is available since SDL 3.0.0.
422 *
423 * \sa SDL_LoadBMP
424 * \sa SDL_SaveBMP_RW
425 */
426extern DECLSPEC int SDLCALL SDL_SaveBMP(SDL_Surface *surface, const char *file);
427
428/**
429 * Set the RLE acceleration hint for a surface.
430 *
431 * If RLE is enabled, color key and alpha blending blits are much faster, but
432 * the surface must be locked before directly accessing the pixels.
433 *
434 * \param surface the SDL_Surface structure to optimize
435 * \param flag 0 to disable, non-zero to enable RLE acceleration
436 * \returns 0 on success or a negative error code on failure; call
437 * SDL_GetError() for more information.
438 *
439 * \since This function is available since SDL 3.0.0.
440 *
441 * \sa SDL_BlitSurface
442 * \sa SDL_LockSurface
443 * \sa SDL_UnlockSurface
444 */
445extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface,
446 int flag);
447
448/**
449 * Returns whether the surface is RLE enabled
450 *
451 * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
452 *
453 * \param surface the SDL_Surface structure to query
454 * \returns SDL_TRUE if the surface is RLE enabled, SDL_FALSE otherwise.
455 *
456 * \since This function is available since SDL 3.0.0.
457 *
458 * \sa SDL_SetSurfaceRLE
459 */
460extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasRLE(SDL_Surface *surface);
461
462/**
463 * Set the color key (transparent pixel) in a surface.
464 *
465 * The color key defines a pixel value that will be treated as transparent in
466 * a blit. For example, one can use this to specify that cyan pixels should be
467 * considered transparent, and therefore not rendered.
468 *
469 * It is a pixel of the format used by the surface, as generated by
470 * SDL_MapRGB().
471 *
472 * RLE acceleration can substantially speed up blitting of images with large
473 * horizontal runs of transparent pixels. See SDL_SetSurfaceRLE() for details.
474 *
475 * \param surface the SDL_Surface structure to update
476 * \param flag SDL_TRUE to enable color key, SDL_FALSE to disable color key
477 * \param key the transparent pixel
478 * \returns 0 on success or a negative error code on failure; call
479 * SDL_GetError() for more information.
480 *
481 * \since This function is available since SDL 3.0.0.
482 *
483 * \sa SDL_BlitSurface
484 * \sa SDL_GetSurfaceColorKey
485 */
486extern DECLSPEC int SDLCALL SDL_SetSurfaceColorKey(SDL_Surface *surface,
487 int flag, Uint32 key);
488
489/**
490 * Returns whether the surface has a color key
491 *
492 * It is safe to pass a NULL `surface` here; it will return SDL_FALSE.
493 *
494 * \param surface the SDL_Surface structure to query
495 * \returns SDL_TRUE if the surface has a color key, SDL_FALSE otherwise.
496 *
497 * \since This function is available since SDL 3.0.0.
498 *
499 * \sa SDL_SetSurfaceColorKey
500 * \sa SDL_GetSurfaceColorKey
501 */
502extern DECLSPEC SDL_bool SDLCALL SDL_SurfaceHasColorKey(SDL_Surface *surface);
503
504/**
505 * Get the color key (transparent pixel) for a surface.
506 *
507 * The color key is a pixel of the format used by the surface, as generated by
508 * SDL_MapRGB().
509 *
510 * If the surface doesn't have color key enabled this function returns -1.
511 *
512 * \param surface the SDL_Surface structure to query
513 * \param key a pointer filled in with the transparent pixel
514 * \returns 0 on success or a negative error code on failure; call
515 * SDL_GetError() for more information.
516 *
517 * \since This function is available since SDL 3.0.0.
518 *
519 * \sa SDL_BlitSurface
520 * \sa SDL_SetSurfaceColorKey
521 */
522extern DECLSPEC int SDLCALL SDL_GetSurfaceColorKey(SDL_Surface *surface,
523 Uint32 *key);
524
525/**
526 * Set an additional color value multiplied into blit operations.
527 *
528 * When this surface is blitted, during the blit operation each source color
529 * channel is modulated by the appropriate color value according to the
530 * following formula:
531 *
532 * `srcC = srcC * (color / 255)`
533 *
534 * \param surface the SDL_Surface structure to update
535 * \param r the red color value multiplied into blit operations
536 * \param g the green color value multiplied into blit operations
537 * \param b the blue color value multiplied into blit operations
538 * \returns 0 on success or a negative error code on failure; call
539 * SDL_GetError() for more information.
540 *
541 * \since This function is available since SDL 3.0.0.
542 *
543 * \sa SDL_GetSurfaceColorMod
544 * \sa SDL_SetSurfaceAlphaMod
545 */
546extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface,
547 Uint8 r, Uint8 g, Uint8 b);
548
549
550/**
551 * Get the additional color value multiplied into blit operations.
552 *
553 * \param surface the SDL_Surface structure to query
554 * \param r a pointer filled in with the current red color value
555 * \param g a pointer filled in with the current green color value
556 * \param b a pointer filled in with the current blue color value
557 * \returns 0 on success or a negative error code on failure; call
558 * SDL_GetError() for more information.
559 *
560 * \since This function is available since SDL 3.0.0.
561 *
562 * \sa SDL_GetSurfaceAlphaMod
563 * \sa SDL_SetSurfaceColorMod
564 */
565extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface,
566 Uint8 *r, Uint8 *g,
567 Uint8 *b);
568
569/**
570 * Set an additional alpha value used in blit operations.
571 *
572 * When this surface is blitted, during the blit operation the source alpha
573 * value is modulated by this alpha value according to the following formula:
574 *
575 * `srcA = srcA * (alpha / 255)`
576 *
577 * \param surface the SDL_Surface structure to update
578 * \param alpha the alpha value multiplied into blit operations
579 * \returns 0 on success or a negative error code on failure; call
580 * SDL_GetError() for more information.
581 *
582 * \since This function is available since SDL 3.0.0.
583 *
584 * \sa SDL_GetSurfaceAlphaMod
585 * \sa SDL_SetSurfaceColorMod
586 */
587extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface,
588 Uint8 alpha);
589
590/**
591 * Get the additional alpha value used in blit operations.
592 *
593 * \param surface the SDL_Surface structure to query
594 * \param alpha a pointer filled in with the current alpha value
595 * \returns 0 on success or a negative error code on failure; call
596 * SDL_GetError() for more information.
597 *
598 * \since This function is available since SDL 3.0.0.
599 *
600 * \sa SDL_GetSurfaceColorMod
601 * \sa SDL_SetSurfaceAlphaMod
602 */
603extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface,
604 Uint8 *alpha);
605
606/**
607 * Set the blend mode used for blit operations.
608 *
609 * To copy a surface to another surface (or texture) without blending with the
610 * existing data, the blendmode of the SOURCE surface should be set to
611 * `SDL_BLENDMODE_NONE`.
612 *
613 * \param surface the SDL_Surface structure to update
614 * \param blendMode the SDL_BlendMode to use for blit blending
615 * \returns 0 on success or a negative error code on failure; call
616 * SDL_GetError() for more information.
617 *
618 * \since This function is available since SDL 3.0.0.
619 *
620 * \sa SDL_GetSurfaceBlendMode
621 */
622extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface,
623 SDL_BlendMode blendMode);
624
625/**
626 * Get the blend mode used for blit operations.
627 *
628 * \param surface the SDL_Surface structure to query
629 * \param blendMode a pointer filled in with the current SDL_BlendMode
630 * \returns 0 on success or a negative error code on failure; call
631 * SDL_GetError() for more information.
632 *
633 * \since This function is available since SDL 3.0.0.
634 *
635 * \sa SDL_SetSurfaceBlendMode
636 */
637extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface,
638 SDL_BlendMode *blendMode);
639
640/**
641 * Set the clipping rectangle for a surface.
642 *
643 * When `surface` is the destination of a blit, only the area within the clip
644 * rectangle is drawn into.
645 *
646 * Note that blits are automatically clipped to the edges of the source and
647 * destination surfaces.
648 *
649 * \param surface the SDL_Surface structure to be clipped
650 * \param rect the SDL_Rect structure representing the clipping rectangle, or
651 * NULL to disable clipping
652 * \returns SDL_TRUE if the rectangle intersects the surface, otherwise
653 * SDL_FALSE and blits will be completely clipped.
654 *
655 * \since This function is available since SDL 3.0.0.
656 *
657 * \sa SDL_BlitSurface
658 * \sa SDL_GetSurfaceClipRect
659 */
660extern DECLSPEC SDL_bool SDLCALL SDL_SetSurfaceClipRect(SDL_Surface *surface,
661 const SDL_Rect *rect);
662
663/**
664 * Get the clipping rectangle for a surface.
665 *
666 * When `surface` is the destination of a blit, only the area within the clip
667 * rectangle is drawn into.
668 *
669 * \param surface the SDL_Surface structure representing the surface to be
670 * clipped
671 * \param rect an SDL_Rect structure filled in with the clipping rectangle for
672 * the surface
673 * \returns 0 on success or a negative error code on failure; call
674 * SDL_GetError() for more information.
675 *
676 * \since This function is available since SDL 3.0.0.
677 *
678 * \sa SDL_BlitSurface
679 * \sa SDL_SetSurfaceClipRect
680 */
681extern DECLSPEC int SDLCALL SDL_GetSurfaceClipRect(SDL_Surface *surface,
682 SDL_Rect *rect);
683
684/*
685 * Flip a surface vertically or horizontally.
686 *
687 * \param surface the surface to flip
688 * \param flip the direction to flip
689 * \returns 0 on success or a negative error code on failure; call
690 * SDL_GetError() for more information.
691 *
692 * \since This function is available since SDL 3.0.0.
693 */
694extern DECLSPEC int SDLCALL SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip);
695
696/*
697 * Creates a new surface identical to the existing surface.
698 *
699 * The returned surface should be freed with SDL_DestroySurface().
700 *
701 * \param surface the surface to duplicate.
702 * \returns a copy of the surface, or NULL on failure; call SDL_GetError() for
703 * more information.
704 *
705 * \since This function is available since SDL 3.0.0.
706 */
707extern DECLSPEC SDL_Surface *SDLCALL SDL_DuplicateSurface(SDL_Surface *surface);
708
709/**
710 * Copy an existing surface to a new surface of the specified format.
711 *
712 * This function is used to optimize images for faster *repeat* blitting. This
713 * is accomplished by converting the original and storing the result as a new
714 * surface. The new, optimized surface can then be used as the source for
715 * future blits, making them faster.
716 *
717 * \param surface the existing SDL_Surface structure to convert
718 * \param format the SDL_PixelFormat structure that the new surface is
719 * optimized for
720 * \returns the new SDL_Surface structure that is created or NULL if it fails;
721 * call SDL_GetError() for more information.
722 *
723 * \since This function is available since SDL 3.0.0.
724 *
725 * \sa SDL_CreatePixelFormat
726 * \sa SDL_ConvertSurfaceFormat
727 * \sa SDL_CreateSurface
728 */
729extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *surface,
730 const SDL_PixelFormat *format);
731
732/**
733 * Copy an existing surface to a new surface of the specified format enum.
734 *
735 * This function operates just like SDL_ConvertSurface(), but accepts an
736 * SDL_PixelFormatEnum value instead of an SDL_PixelFormat structure. As such,
737 * it might be easier to call but it doesn't have access to palette
738 * information for the destination surface, in case that would be important.
739 *
740 * \param surface the existing SDL_Surface structure to convert
741 * \param pixel_format the SDL_PixelFormatEnum that the new surface is
742 * optimized for
743 * \returns the new SDL_Surface structure that is created or NULL if it fails;
744 * call SDL_GetError() for more information.
745 *
746 * \since This function is available since SDL 3.0.0.
747 *
748 * \sa SDL_CreatePixelFormat
749 * \sa SDL_ConvertSurface
750 * \sa SDL_CreateSurface
751 */
752extern DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *surface,
753 Uint32 pixel_format);
754
755/**
756 * Copy a block of pixels of one format to another format.
757 *
758 * \param width the width of the block to copy, in pixels
759 * \param height the height of the block to copy, in pixels
760 * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
761 * \param src a pointer to the source pixels
762 * \param src_pitch the pitch of the source pixels, in bytes
763 * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
764 * \param dst a pointer to be filled in with new pixel data
765 * \param dst_pitch the pitch of the destination pixels, in bytes
766 * \returns 0 on success or a negative error code on failure; call
767 * SDL_GetError() for more information.
768 *
769 * \since This function is available since SDL 3.0.0.
770 */
771extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
772 Uint32 src_format,
773 const void *src, int src_pitch,
774 Uint32 dst_format,
775 void *dst, int dst_pitch);
776
777/**
778 * Premultiply the alpha on a block of pixels.
779 *
780 * This is safe to use with src == dst, but not for other overlapping areas.
781 *
782 * This function is currently only implemented for SDL_PIXELFORMAT_ARGB8888.
783 *
784 * \param width the width of the block to convert, in pixels
785 * \param height the height of the block to convert, in pixels
786 * \param src_format an SDL_PixelFormatEnum value of the `src` pixels format
787 * \param src a pointer to the source pixels
788 * \param src_pitch the pitch of the source pixels, in bytes
789 * \param dst_format an SDL_PixelFormatEnum value of the `dst` pixels format
790 * \param dst a pointer to be filled in with premultiplied pixel data
791 * \param dst_pitch the pitch of the destination pixels, in bytes
792 * \returns 0 on success or a negative error code on failure; call
793 * SDL_GetError() for more information.
794 *
795 * \since This function is available since SDL 3.0.0.
796 */
797extern DECLSPEC int SDLCALL SDL_PremultiplyAlpha(int width, int height,
798 Uint32 src_format,
799 const void *src, int src_pitch,
800 Uint32 dst_format,
801 void *dst, int dst_pitch);
802
803/**
804 * Perform a fast fill of a rectangle with a specific color.
805 *
806 * `color` should be a pixel of the format used by the surface, and can be
807 * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
808 * alpha component then the destination is simply filled with that alpha
809 * information, no blending takes place.
810 *
811 * If there is a clip rectangle set on the destination (set via
812 * SDL_SetSurfaceClipRect()), then this function will fill based on the
813 * intersection of the clip rectangle and `rect`.
814 *
815 * \param dst the SDL_Surface structure that is the drawing target
816 * \param rect the SDL_Rect structure representing the rectangle to fill, or
817 * NULL to fill the entire surface
818 * \param color the color to fill with
819 * \returns 0 on success or a negative error code on failure; call
820 * SDL_GetError() for more information.
821 *
822 * \since This function is available since SDL 3.0.0.
823 *
824 * \sa SDL_FillSurfaceRects
825 */
826extern DECLSPEC int SDLCALL SDL_FillSurfaceRect
827 (SDL_Surface *dst, const SDL_Rect *rect, Uint32 color);
828
829/**
830 * Perform a fast fill of a set of rectangles with a specific color.
831 *
832 * `color` should be a pixel of the format used by the surface, and can be
833 * generated by SDL_MapRGB() or SDL_MapRGBA(). If the color value contains an
834 * alpha component then the destination is simply filled with that alpha
835 * information, no blending takes place.
836 *
837 * If there is a clip rectangle set on the destination (set via
838 * SDL_SetSurfaceClipRect()), then this function will fill based on the
839 * intersection of the clip rectangle and `rect`.
840 *
841 * \param dst the SDL_Surface structure that is the drawing target
842 * \param rects an array of SDL_Rects representing the rectangles to fill.
843 * \param count the number of rectangles in the array
844 * \param color the color to fill with
845 * \returns 0 on success or a negative error code on failure; call
846 * SDL_GetError() for more information.
847 *
848 * \since This function is available since SDL 3.0.0.
849 *
850 * \sa SDL_FillSurfaceRect
851 */
852extern DECLSPEC int SDLCALL SDL_FillSurfaceRects
853 (SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color);
854
855/**
856 * Performs a fast blit from the source surface to the destination surface.
857 *
858 * This assumes that the source and destination rectangles are the same size.
859 * If either `srcrect` or `dstrect` are NULL, the entire surface (`src` or
860 * `dst`) is copied. The final blit rectangles are saved in `srcrect` and
861 * `dstrect` after all clipping is performed.
862 *
863 * The blit function should not be called on a locked surface.
864 *
865 * The blit semantics for surfaces with and without blending and colorkey are
866 * defined as follows:
867 *
868 * ```c
869 * RGBA->RGB:
870 * Source surface blend mode set to SDL_BLENDMODE_BLEND:
871 * alpha-blend (using the source alpha-channel and per-surface alpha)
872 * SDL_SRCCOLORKEY ignored.
873 * Source surface blend mode set to SDL_BLENDMODE_NONE:
874 * copy RGB.
875 * if SDL_SRCCOLORKEY set, only copy the pixels matching the
876 * RGB values of the source color key, ignoring alpha in the
877 * comparison.
878 *
879 * RGB->RGBA:
880 * Source surface blend mode set to SDL_BLENDMODE_BLEND:
881 * alpha-blend (using the source per-surface alpha)
882 * Source surface blend mode set to SDL_BLENDMODE_NONE:
883 * copy RGB, set destination alpha to source per-surface alpha value.
884 * both:
885 * if SDL_SRCCOLORKEY set, only copy the pixels matching the
886 * source color key.
887 *
888 * RGBA->RGBA:
889 * Source surface blend mode set to SDL_BLENDMODE_BLEND:
890 * alpha-blend (using the source alpha-channel and per-surface alpha)
891 * SDL_SRCCOLORKEY ignored.
892 * Source surface blend mode set to SDL_BLENDMODE_NONE:
893 * copy all of RGBA to the destination.
894 * if SDL_SRCCOLORKEY set, only copy the pixels matching the
895 * RGB values of the source color key, ignoring alpha in the
896 * comparison.
897 *
898 * RGB->RGB:
899 * Source surface blend mode set to SDL_BLENDMODE_BLEND:
900 * alpha-blend (using the source per-surface alpha)
901 * Source surface blend mode set to SDL_BLENDMODE_NONE:
902 * copy RGB.
903 * both:
904 * if SDL_SRCCOLORKEY set, only copy the pixels matching the
905 * source color key.
906 * ```
907 *
908 * \param src the SDL_Surface structure to be copied from
909 * \param srcrect the SDL_Rect structure representing the rectangle to be
910 * copied, or NULL to copy the entire surface
911 * \param dst the SDL_Surface structure that is the blit target
912 * \param dstrect the SDL_Rect structure representing the x and y position in
913 * the destination surface. On input the width and height are
914 * ignored (taken from srcrect), and on output this is filled
915 * in with the actual rectangle used after clipping.
916 * \returns 0 on success or a negative error code on failure; call
917 * SDL_GetError() for more information.
918 *
919 * \since This function is available since SDL 3.0.0.
920 *
921 * \sa SDL_BlitSurfaceScaled
922 */
923extern DECLSPEC int SDLCALL SDL_BlitSurface
924 (SDL_Surface *src, const SDL_Rect *srcrect,
925 SDL_Surface *dst, SDL_Rect *dstrect);
926
927/**
928 * Perform low-level surface blitting only.
929 *
930 * This is a semi-private blit function and it performs low-level surface
931 * blitting, assuming the input rectangles have already been clipped.
932 *
933 * \param src the SDL_Surface structure to be copied from
934 * \param srcrect the SDL_Rect structure representing the rectangle to be
935 * copied, or NULL to copy the entire surface
936 * \param dst the SDL_Surface structure that is the blit target
937 * \param dstrect the SDL_Rect structure representing the target rectangle in
938 * the destination surface
939 * \returns 0 on success or a negative error code on failure; call
940 * SDL_GetError() for more information.
941 *
942 * \since This function is available since SDL 3.0.0.
943 *
944 * \sa SDL_BlitSurface
945 */
946extern DECLSPEC int SDLCALL SDL_BlitSurfaceUnchecked
947 (SDL_Surface *src, const SDL_Rect *srcrect,
948 SDL_Surface *dst, const SDL_Rect *dstrect);
949
950/**
951 * Perform stretch blit between two surfaces of the same format.
952 *
953 * Using SDL_SCALEMODE_NEAREST: fast, low quality. Using SDL_SCALEMODE_LINEAR:
954 * bilinear scaling, slower, better quality, only 32BPP.
955 *
956 * \param src the SDL_Surface structure to be copied from
957 * \param srcrect the SDL_Rect structure representing the rectangle to be
958 * copied
959 * \param dst the SDL_Surface structure that is the blit target
960 * \param dstrect the SDL_Rect structure representing the target rectangle in
961 * the destination surface
962 * \param scaleMode scale algorithm to be used
963 * \returns 0 on success or a negative error code on failure; call
964 * SDL_GetError() for more information.
965 *
966 * \since This function is available since SDL 3.0.0.
967 *
968 * \sa SDL_BlitSurfaceScaled
969 */
970extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src,
971 const SDL_Rect *srcrect,
972 SDL_Surface *dst,
973 const SDL_Rect *dstrect,
974 SDL_ScaleMode scaleMode);
975
976/**
977 * Perform a scaled surface copy to a destination surface.
978 *
979 * \param src the SDL_Surface structure to be copied from
980 * \param srcrect the SDL_Rect structure representing the rectangle to be
981 * copied
982 * \param dst the SDL_Surface structure that is the blit target
983 * \param dstrect the SDL_Rect structure representing the target rectangle in
984 * the destination surface, filled with the actual rectangle
985 * used after clipping
986 * \param scaleMode scale algorithm to be used
987 * \returns 0 on success or a negative error code on failure; call
988 * SDL_GetError() for more information.
989 *
990 * \since This function is available since SDL 3.0.0.
991 *
992 * \sa SDL_BlitSurface
993 */
994extern DECLSPEC int SDLCALL SDL_BlitSurfaceScaled(SDL_Surface *src,
995 const SDL_Rect *srcrect,
996 SDL_Surface *dst,
997 SDL_Rect *dstrect,
998 SDL_ScaleMode scaleMode);
999
1000/**
1001 * Perform low-level surface scaled blitting only.
1002 *
1003 * This is a semi-private function and it performs low-level surface blitting,
1004 * assuming the input rectangles have already been clipped.
1005 *
1006 * \param src the SDL_Surface structure to be copied from
1007 * \param srcrect the SDL_Rect structure representing the rectangle to be
1008 * copied
1009 * \param dst the SDL_Surface structure that is the blit target
1010 * \param dstrect the SDL_Rect structure representing the target rectangle in
1011 * the destination surface
1012 * \param scaleMode scale algorithm to be used
1013 * \returns 0 on success or a negative error code on failure; call
1014 * SDL_GetError() for more information.
1015 *
1016 * \since This function is available since SDL 3.0.0.
1017 *
1018 * \sa SDL_BlitSurfaceScaled
1019 */
1020extern DECLSPEC int SDLCALL SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src,
1021 const SDL_Rect *srcrect,
1022 SDL_Surface *dst,
1023 const SDL_Rect *dstrect,
1024 SDL_ScaleMode scaleMode);
1025
1026/**
1027 * Retrieves a single pixel from a surface.
1028 *
1029 * This function prioritizes correctness over speed: it is suitable for unit
1030 * tests, but is not intended for use in a game engine.
1031 *
1032 * Like SDL_GetRGBA, this uses the entire 0..255 range when converting color
1033 * components from pixel formats with less than 8 bits per RGB component.
1034 *
1035 * \param surface the surface to read
1036 * \param x the horizontal coordinate, 0 <= x < width
1037 * \param y the vertical coordinate, 0 <= y < height
1038 * \param r a pointer filled in with the red channel, 0-255, or NULL to ignore
1039 * this channel
1040 * \param g a pointer filled in with the green channel, 0-255, or NULL to
1041 * ignore this channel
1042 * \param b a pointer filled in with the blue channel, 0-255, or NULL to
1043 * ignore this channel
1044 * \param a a pointer filled in with the alpha channel, 0-255, or NULL to
1045 * ignore this channel
1046 * \returns 0 on success or a negative error code on failure; call
1047 * SDL_GetError() for more information.
1048 *
1049 * \since This function is available since SDL 3.0.0.
1050 */
1051extern DECLSPEC int SDLCALL SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a);
1052
1053
1054/**
1055 * Set the YUV conversion mode
1056 *
1057 * \param mode YUV conversion mode
1058 *
1059 * \since This function is available since SDL 3.0.0.
1060 */
1061extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode);
1062
1063/**
1064 * Get the YUV conversion mode
1065 *
1066 * \returns YUV conversion mode
1067 *
1068 * \since This function is available since SDL 3.0.0.
1069 */
1071
1072/**
1073 * Get the YUV conversion mode, returning the correct mode for the resolution
1074 * when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC
1075 *
1076 * \param width width
1077 * \param height height
1078 * \returns YUV conversion mode
1079 *
1080 * \since This function is available since SDL 3.0.0.
1081 */
1082extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height);
1083
1084/* Ends C function definitions when using C++ */
1085#ifdef __cplusplus
1086}
1087#endif
1088#include <SDL3/SDL_close_code.h>
1089
1090#endif /* SDL_surface_h_ */
SDL_BlendMode
Uint32 SDL_PropertiesID
uint8_t Uint8
Definition SDL_stdinc.h:150
int SDL_bool
Definition SDL_stdinc.h:137
uint32_t Uint32
Definition SDL_stdinc.h:174
SDL_YUV_CONVERSION_MODE
@ SDL_YUV_CONVERSION_BT601
@ SDL_YUV_CONVERSION_JPEG
@ SDL_YUV_CONVERSION_BT709
@ SDL_YUV_CONVERSION_AUTOMATIC
int SDL_FillSurfaceRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color)
int SDL_ReadSurfacePixel(SDL_Surface *surface, int x, int y, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
SDL_PropertiesID SDL_GetSurfaceProperties(SDL_Surface *surface)
int(* SDL_blit)(struct SDL_Surface *src, const SDL_Rect *srcrect, struct SDL_Surface *dst, const SDL_Rect *dstrect)
int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode)
void SDL_DestroySurface(SDL_Surface *surface)
SDL_Surface * SDL_ConvertSurfaceFormat(SDL_Surface *surface, Uint32 pixel_format)
SDL_Surface * SDL_CreateSurfaceFrom(void *pixels, int width, int height, int pitch, Uint32 format)
int SDL_BlitSurfaceUnchecked(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect)
int SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette)
int SDL_BlitSurfaceUncheckedScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode)
SDL_Surface * SDL_DuplicateSurface(SDL_Surface *surface)
SDL_ColorPrimaries
@ SDL_COLOR_PRIMARIES_SMPTE431
@ SDL_COLOR_PRIMARIES_EBU3213
@ SDL_COLOR_PRIMARIES_GENERIC_FILM
@ SDL_COLOR_PRIMARIES_BT601
@ SDL_COLOR_PRIMARIES_UNSPECIFIED
@ SDL_COLOR_PRIMARIES_IEC61966_2_4
@ SDL_COLOR_PRIMARIES_SMPTE240
@ SDL_COLOR_PRIMARIES_XYZ
@ SDL_COLOR_PRIMARIES_UNKNOWN
@ SDL_COLOR_PRIMARIES_SMPTE432
@ SDL_COLOR_PRIMARIES_BT2020
@ SDL_COLOR_PRIMARIES_BT470BG
@ SDL_COLOR_PRIMARIES_BT709
@ SDL_COLOR_PRIMARIES_BT470M
int SDL_FillSurfaceRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color)
int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag)
int SDL_LockSurface(SDL_Surface *surface)
int SDL_GetSurfaceClipRect(SDL_Surface *surface, SDL_Rect *rect)
int SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha)
int SDL_BlitSurfaceScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, SDL_ScaleMode scaleMode)
SDL_ScaleMode
Definition SDL_surface.h:72
@ SDL_SCALEMODE_LINEAR
Definition SDL_surface.h:74
@ SDL_SCALEMODE_NEAREST
Definition SDL_surface.h:73
@ SDL_SCALEMODE_BEST
Definition SDL_surface.h:75
SDL_TransferCharacteristics
@ SDL_TRANSFER_CHARACTERISTICS_BT709
@ SDL_TRANSFER_CHARACTERISTICS_BT1361
@ SDL_TRANSFER_CHARACTERISTICS_HLG
@ SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10
@ SDL_TRANSFER_CHARACTERISTICS_UNKNOWN
@ SDL_TRANSFER_CHARACTERISTICS_BT601
@ SDL_TRANSFER_CHARACTERISTICS_BT470BG
@ SDL_TRANSFER_CHARACTERISTICS_IEC61966
@ SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED
@ SDL_TRANSFER_CHARACTERISTICS_SMPTE428
@ SDL_TRANSFER_CHARACTERISTICS_LOG100
@ SDL_TRANSFER_CHARACTERISTICS_SMPTE240
@ SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT
@ SDL_TRANSFER_CHARACTERISTICS_SRGB
@ SDL_TRANSFER_CHARACTERISTICS_SMPTE2084
@ SDL_TRANSFER_CHARACTERISTICS_BT470M
@ SDL_TRANSFER_CHARACTERISTICS_LINEAR
@ SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT
int SDL_PremultiplyAlpha(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
SDL_Surface * SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format)
int SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect, SDL_ScaleMode scaleMode)
struct SDL_BlitMap SDL_BlitMap
Definition SDL_surface.h:66
int SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b)
int SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key)
SDL_Surface * SDL_CreateSurface(int width, int height, Uint32 format)
SDL_FlipMode
Definition SDL_surface.h:82
@ SDL_FLIP_VERTICAL
Definition SDL_surface.h:85
@ SDL_FLIP_NONE
Definition SDL_surface.h:83
@ SDL_FLIP_HORIZONTAL
Definition SDL_surface.h:84
int SDL_SaveBMP(SDL_Surface *surface, const char *file)
void SDL_UnlockSurface(SDL_Surface *surface)
int SDL_BlitSurface(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect)
int SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b)
SDL_Surface * SDL_LoadBMP_RW(SDL_RWops *src, SDL_bool freesrc)
int SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha)
SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface)
int SDL_ConvertPixels(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
int SDL_FlipSurface(SDL_Surface *surface, SDL_FlipMode flip)
int SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, SDL_bool freedst)
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionMode(void)
int SDL_GetSurfaceColorKey(SDL_Surface *surface, Uint32 *key)
SDL_bool SDL_SurfaceHasRLE(SDL_Surface *surface)
SDL_Surface * SDL_LoadBMP(const char *file)
int SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode)
void SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode)
SDL_YUV_CONVERSION_MODE SDL_GetYUVConversionModeForResolution(int width, int height)
SDL_PixelFormat * format
void * list_blitmap
void * reserved
SDL_Rect clip_rect
void * pixels
SDL_BlitMap * map