# CategorySurface

SDL surfaces are buffers of pixels in system RAM. These are useful for
passing around and manipulating images that are not stored in GPU memory.

[SDL_Surface](SDL_Surface) makes serious efforts to manage images in
various formats, and provides a reasonable toolbox for transforming the
data, including copying between surfaces, filling rectangles in the image
data, etc.

There is also a simple .bmp loader,
[SDL_LoadBMP](SDL_LoadBMP)(), a simple .png loader,
[SDL_LoadPNG](SDL_LoadPNG)(), and a simple .jpg loader, [SDL_LoadJPG](SDL_LoadJPG)(). SDL itself does not
provide loaders for other file formats, but there are several excellent
external libraries that do, including its own satellite library,
[SDL_image](https://wiki.libsdl.org/SDL3_image)
.

In general these functions are thread-safe in that they can be called on
different threads with different surfaces. You should not try to modify any
surface from two threads simultaneously.

<!-- END CATEGORY DOCUMENTATION -->

## Functions

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategorySurface, CategoryAPIFunction -->
- [SDL_AddSurfaceAlternateImage](SDL_AddSurfaceAlternateImage)
- [SDL_BlitSurface](SDL_BlitSurface)
- [SDL_BlitSurface9Grid](SDL_BlitSurface9Grid)
- [SDL_BlitSurfaceScaled](SDL_BlitSurfaceScaled)
- [SDL_BlitSurfaceTiled](SDL_BlitSurfaceTiled)
- [SDL_BlitSurfaceTiledWithScale](SDL_BlitSurfaceTiledWithScale)
- [SDL_BlitSurfaceUnchecked](SDL_BlitSurfaceUnchecked)
- [SDL_BlitSurfaceUncheckedScaled](SDL_BlitSurfaceUncheckedScaled)
- [SDL_ClearSurface](SDL_ClearSurface)
- [SDL_ConvertPixels](SDL_ConvertPixels)
- [SDL_ConvertPixelsAndColorspace](SDL_ConvertPixelsAndColorspace)
- [SDL_ConvertSurface](SDL_ConvertSurface)
- [SDL_ConvertSurfaceAndColorspace](SDL_ConvertSurfaceAndColorspace)
- [SDL_CreateSurface](SDL_CreateSurface)
- [SDL_CreateSurfaceFrom](SDL_CreateSurfaceFrom)
- [SDL_CreateSurfacePalette](SDL_CreateSurfacePalette)
- [SDL_DestroySurface](SDL_DestroySurface)
- [SDL_DuplicateSurface](SDL_DuplicateSurface)
- [SDL_FillSurfaceRect](SDL_FillSurfaceRect)
- [SDL_FillSurfaceRects](SDL_FillSurfaceRects)
- [SDL_FlipSurface](SDL_FlipSurface)
- [SDL_GetSurfaceAlphaMod](SDL_GetSurfaceAlphaMod)
- [SDL_GetSurfaceBlendMode](SDL_GetSurfaceBlendMode)
- [SDL_GetSurfaceClipRect](SDL_GetSurfaceClipRect)
- [SDL_GetSurfaceColorKey](SDL_GetSurfaceColorKey)
- [SDL_GetSurfaceColorMod](SDL_GetSurfaceColorMod)
- [SDL_GetSurfaceColorspace](SDL_GetSurfaceColorspace)
- [SDL_GetSurfaceImages](SDL_GetSurfaceImages)
- [SDL_GetSurfacePalette](SDL_GetSurfacePalette)
- [SDL_GetSurfaceProperties](SDL_GetSurfaceProperties)
- [SDL_LoadBMP](SDL_LoadBMP)
- [SDL_LoadBMP_IO](SDL_LoadBMP_IO)
- [SDL_LoadJPG](SDL_LoadJPG)
- [SDL_LoadJPG_IO](SDL_LoadJPG_IO)
- [SDL_LoadPNG](SDL_LoadPNG)
- [SDL_LoadPNG_IO](SDL_LoadPNG_IO)
- [SDL_LoadSurface](SDL_LoadSurface)
- [SDL_LoadSurface_IO](SDL_LoadSurface_IO)
- [SDL_LockSurface](SDL_LockSurface)
- [SDL_MapSurfaceRGB](SDL_MapSurfaceRGB)
- [SDL_MapSurfaceRGBA](SDL_MapSurfaceRGBA)
- [SDL_PremultiplyAlpha](SDL_PremultiplyAlpha)
- [SDL_PremultiplySurfaceAlpha](SDL_PremultiplySurfaceAlpha)
- [SDL_ReadSurfacePixel](SDL_ReadSurfacePixel)
- [SDL_ReadSurfacePixelFloat](SDL_ReadSurfacePixelFloat)
- [SDL_RemoveSurfaceAlternateImages](SDL_RemoveSurfaceAlternateImages)
- [SDL_RotateSurface](SDL_RotateSurface)
- [SDL_SaveBMP](SDL_SaveBMP)
- [SDL_SaveBMP_IO](SDL_SaveBMP_IO)
- [SDL_SavePNG](SDL_SavePNG)
- [SDL_SavePNG_IO](SDL_SavePNG_IO)
- [SDL_ScaleSurface](SDL_ScaleSurface)
- [SDL_SetSurfaceAlphaMod](SDL_SetSurfaceAlphaMod)
- [SDL_SetSurfaceBlendMode](SDL_SetSurfaceBlendMode)
- [SDL_SetSurfaceClipRect](SDL_SetSurfaceClipRect)
- [SDL_SetSurfaceColorKey](SDL_SetSurfaceColorKey)
- [SDL_SetSurfaceColorMod](SDL_SetSurfaceColorMod)
- [SDL_SetSurfaceColorspace](SDL_SetSurfaceColorspace)
- [SDL_SetSurfacePalette](SDL_SetSurfacePalette)
- [SDL_SetSurfaceRLE](SDL_SetSurfaceRLE)
- [SDL_StretchSurface](SDL_StretchSurface)
- [SDL_SurfaceHasAlternateImages](SDL_SurfaceHasAlternateImages)
- [SDL_SurfaceHasColorKey](SDL_SurfaceHasColorKey)
- [SDL_SurfaceHasRLE](SDL_SurfaceHasRLE)
- [SDL_UnlockSurface](SDL_UnlockSurface)
- [SDL_WriteSurfacePixel](SDL_WriteSurfacePixel)
- [SDL_WriteSurfacePixelFloat](SDL_WriteSurfacePixelFloat)
<!-- END CATEGORY LIST -->

## Datatypes

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategorySurface, CategoryAPIDatatype -->
- [SDL_SurfaceFlags](SDL_SurfaceFlags)
<!-- END CATEGORY LIST -->

## Structs

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategorySurface, CategoryAPIStruct -->
- [SDL_Surface](SDL_Surface)
<!-- END CATEGORY LIST -->

## Enums

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategorySurface, CategoryAPIEnum -->
- [SDL_FlipMode](SDL_FlipMode)
- [SDL_ScaleMode](SDL_ScaleMode)
<!-- END CATEGORY LIST -->

## Macros

<!-- DO NOT HAND-EDIT CATEGORY LISTS, THEY ARE AUTOGENERATED AND WILL BE OVERWRITTEN, BASED ON TAGS IN INDIVIDUAL PAGE FOOTERS. EDIT THOSE INSTEAD. -->
<!-- BEGIN CATEGORY LIST: CategorySurface, CategoryAPIMacro -->
- [SDL_MUSTLOCK](SDL_MUSTLOCK)
<!-- END CATEGORY LIST -->


----
[CategoryAPICategory](CategoryAPICategory)

