sdlGetSurfaceColorspace function

int sdlGetSurfaceColorspace(
  1. Pointer<SdlSurface> surface
)

Get the colorspace used by a surface.

The colorspace defaults to SDL_COLORSPACE_SRGB_LINEAR for floating point formats, SDL_COLORSPACE_HDR10 for 10-bit formats, SDL_COLORSPACE_SRGB for other RGB surfaces and SDL_COLORSPACE_BT709_FULL for YUV textures.

\param surface the SDL_Surface structure to query. \returns the colorspace used by the surface, or SDL_COLORSPACE_UNKNOWN if the surface is NULL.

\since This function is available since SDL 3.1.3.

\sa SDL_SetSurfaceColorspace

extern SDL_DECLSPEC SDL_Colorspace SDLCALL SDL_GetSurfaceColorspace(SDL_Surface *surface)

Implementation

int sdlGetSurfaceColorspace(Pointer<SdlSurface> surface) {
  final sdlGetSurfaceColorspaceLookupFunction = libSdl3.lookupFunction<
      Int32 Function(Pointer<SdlSurface> surface),
      int Function(Pointer<SdlSurface> surface)>('SDL_GetSurfaceColorspace');
  return sdlGetSurfaceColorspaceLookupFunction(surface);
}