from sdl3.SDL import * # type: ignore
from sdl3 import SDL_POINTER
import ctypes, typing
LP_IMG_Animation: typing.TypeAlias = SDL_POINTER[IMG_Animation]
LP_IMG_AnimationEncoder: typing.TypeAlias = SDL_POINTER[IMG_AnimationEncoder]
LP_SDL_GPUDevice: typing.TypeAlias = SDL_POINTER[SDL_GPUDevice]
LP_LP_SDL_Surface: typing.TypeAlias = SDL_POINTER[SDL_POINTER[SDL_Surface]]
LP_c_uint64: typing.TypeAlias = SDL_POINTER[ctypes.c_uint64]
LP_SDL_GPUTexture: typing.TypeAlias = SDL_POINTER[SDL_GPUTexture]
LP_SDL_Renderer: typing.TypeAlias = SDL_POINTER[SDL_Renderer]
LP_SDL_GPUCopyPass: typing.TypeAlias = SDL_POINTER[SDL_GPUCopyPass]
LP_SDL_Surface: typing.TypeAlias = SDL_POINTER[SDL_Surface]
LP_c_int: typing.TypeAlias = SDL_POINTER[ctypes.c_int]
LP_SDL_Cursor: typing.TypeAlias = SDL_POINTER[SDL_Cursor]
LP_SDL_IOStream: typing.TypeAlias = SDL_POINTER[SDL_IOStream]
LP_SDL_Texture: typing.TypeAlias = SDL_POINTER[SDL_Texture]
LP_IMG_AnimationDecoder: typing.TypeAlias = SDL_POINTER[IMG_AnimationDecoder]
LP_c_char_p: typing.TypeAlias = SDL_POINTER[ctypes.c_char_p]
[docs]
def IMG_Version() -> ctypes.c_int:
"""
This function gets the version of the dynamically linked SDL_image library.
"""
[docs]
def IMG_Load(file: ctypes.c_char_p) -> LP_SDL_Surface:
"""
Load an image from a filesystem path into a software surface.
"""
[docs]
def IMG_Load_IO(src: LP_SDL_IOStream, closeio: ctypes.c_bool) -> LP_SDL_Surface:
"""
Load an image from an SDL data source into a software surface.
"""
[docs]
def IMG_LoadTyped_IO(src: LP_SDL_IOStream, closeio: ctypes.c_bool, type: ctypes.c_char_p) -> LP_SDL_Surface:
"""
Load an image from an SDL data source into a software surface.
"""
[docs]
def IMG_LoadTexture(renderer: LP_SDL_Renderer, file: ctypes.c_char_p) -> LP_SDL_Texture:
"""
Load an image from a filesystem path into a texture.
"""
[docs]
def IMG_LoadTexture_IO(renderer: LP_SDL_Renderer, src: LP_SDL_IOStream, closeio: ctypes.c_bool) -> LP_SDL_Texture:
"""
Load an image from an SDL data source into a texture.
"""
[docs]
def IMG_LoadTextureTyped_IO(renderer: LP_SDL_Renderer, src: LP_SDL_IOStream, closeio: ctypes.c_bool, type: ctypes.c_char_p) -> LP_SDL_Texture:
"""
Load an image from an SDL data source into a texture.
"""
[docs]
def IMG_LoadGPUTexture(device: LP_SDL_GPUDevice, copy_pass: LP_SDL_GPUCopyPass, file: ctypes.c_char_p, width: LP_c_int, height: LP_c_int) -> LP_SDL_GPUTexture:
"""
Load an image from a filesystem path into a GPU texture.
"""
[docs]
def IMG_LoadGPUTexture_IO(device: LP_SDL_GPUDevice, copy_pass: LP_SDL_GPUCopyPass, src: LP_SDL_IOStream, closeio: ctypes.c_bool, width: LP_c_int, height: LP_c_int) -> LP_SDL_GPUTexture:
"""
Load an image from an SDL data source into a GPU texture.
"""
[docs]
def IMG_LoadGPUTextureTyped_IO(device: LP_SDL_GPUDevice, copy_pass: LP_SDL_GPUCopyPass, src: LP_SDL_IOStream, closeio: ctypes.c_bool, type: ctypes.c_char_p, width: LP_c_int, height: LP_c_int) -> LP_SDL_GPUTexture:
"""
Load an image from an SDL data source into a GPU texture.
"""
[docs]
def IMG_GetClipboardImage() -> LP_SDL_Surface:
"""
Get the image currently in the clipboard.
"""
[docs]
def IMG_isANI(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect ANI animated cursor data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isAVIF(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect AVIF image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isCUR(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect CUR image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isBMP(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect BMP image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isGIF(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect GIF image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isICO(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect ICO image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isJPG(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect JPG image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isJXL(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect JXL image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isLBM(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect LBM image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isPCX(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect PCX image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isPNG(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect PNG image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isPNM(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect PNM image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isQOI(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect QOI image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isSVG(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect SVG image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isTIF(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect TIFF image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isWEBP(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect WEBP image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isXCF(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect XCF image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isXPM(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect XPM image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_isXV(src: LP_SDL_IOStream) -> ctypes.c_bool:
"""
Detect XV image data on a readable/seekable SDL_IOStream.
"""
[docs]
def IMG_LoadAVIF_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a AVIF image directly.
"""
[docs]
def IMG_LoadBMP_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a BMP image directly.
"""
[docs]
def IMG_LoadCUR_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a CUR image directly.
"""
[docs]
def IMG_LoadGIF_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a GIF image directly.
"""
[docs]
def IMG_LoadICO_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a ICO image directly.
"""
[docs]
def IMG_LoadJPG_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a JPG image directly.
"""
[docs]
def IMG_LoadJXL_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a JXL image directly.
"""
[docs]
def IMG_LoadLBM_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a LBM image directly.
"""
[docs]
def IMG_LoadPCX_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a PCX image directly.
"""
[docs]
def IMG_LoadPNG_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a PNG image directly.
"""
[docs]
def IMG_LoadPNM_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a PNM image directly.
"""
[docs]
def IMG_LoadQOI_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a QOI image directly.
"""
[docs]
def IMG_LoadSVG_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a SVG image directly.
"""
[docs]
def IMG_LoadSizedSVG_IO(src: LP_SDL_IOStream, width: ctypes.c_int, height: ctypes.c_int) -> LP_SDL_Surface:
"""
Load an SVG image, scaled to a specific size.
"""
[docs]
def IMG_LoadTGA_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a TGA image directly.
"""
[docs]
def IMG_LoadTIF_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a TIFF image directly.
"""
[docs]
def IMG_LoadWEBP_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a WEBP image directly.
"""
[docs]
def IMG_LoadXCF_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a XCF image directly.
"""
[docs]
def IMG_LoadXPM_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a XPM image directly.
"""
[docs]
def IMG_LoadXV_IO(src: LP_SDL_IOStream) -> LP_SDL_Surface:
"""
Load a XV image directly.
"""
[docs]
def IMG_ReadXPMFromArray(xpm: LP_c_char_p) -> LP_SDL_Surface:
"""
Load an XPM image from a memory array.
"""
[docs]
def IMG_ReadXPMFromArrayToRGB888(xpm: LP_c_char_p) -> LP_SDL_Surface:
"""
Load an XPM image from a memory array.
"""
[docs]
def IMG_Save(surface: LP_SDL_Surface, file: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an SDL_Surface into an image file.
"""
[docs]
def IMG_SaveTyped_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool, type: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an SDL_Surface into formatted image data, via an SDL_IOStream.
"""
[docs]
def IMG_SaveAVIF(surface: LP_SDL_Surface, file: ctypes.c_char_p, quality: ctypes.c_int) -> ctypes.c_bool:
"""
Save an SDL_Surface into a AVIF image file.
"""
[docs]
def IMG_SaveAVIF_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool, quality: ctypes.c_int) -> ctypes.c_bool:
"""
Save an SDL_Surface into AVIF image data, via an SDL_IOStream.
"""
[docs]
def IMG_SaveBMP(surface: LP_SDL_Surface, file: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an SDL_Surface into a BMP image file.
"""
[docs]
def IMG_SaveBMP_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an SDL_Surface into BMP image data, via an SDL_IOStream.
"""
[docs]
def IMG_SaveCUR(surface: LP_SDL_Surface, file: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an SDL_Surface into a CUR image file.
"""
[docs]
def IMG_SaveCUR_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an SDL_Surface into CUR image data, via an SDL_IOStream.
"""
[docs]
def IMG_SaveGIF(surface: LP_SDL_Surface, file: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an SDL_Surface into a GIF image file.
"""
[docs]
def IMG_SaveGIF_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an SDL_Surface into GIF image data, via an SDL_IOStream.
"""
[docs]
def IMG_SaveICO(surface: LP_SDL_Surface, file: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an SDL_Surface into a ICO image file.
"""
[docs]
def IMG_SaveICO_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an SDL_Surface into ICO image data, via an SDL_IOStream.
"""
[docs]
def IMG_SaveJPG(surface: LP_SDL_Surface, file: ctypes.c_char_p, quality: ctypes.c_int) -> ctypes.c_bool:
"""
Save an SDL_Surface into a JPEG image file.
"""
[docs]
def IMG_SaveJPG_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool, quality: ctypes.c_int) -> ctypes.c_bool:
"""
Save an SDL_Surface into JPEG image data, via an SDL_IOStream.
"""
[docs]
def IMG_SavePNG(surface: LP_SDL_Surface, file: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an SDL_Surface into a PNG image file.
"""
[docs]
def IMG_SavePNG_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an SDL_Surface into PNG image data, via an SDL_IOStream.
"""
[docs]
def IMG_SaveTGA(surface: LP_SDL_Surface, file: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an SDL_Surface into a TGA image file.
"""
[docs]
def IMG_SaveTGA_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an SDL_Surface into TGA image data, via an SDL_IOStream.
"""
[docs]
def IMG_SaveWEBP(surface: LP_SDL_Surface, file: ctypes.c_char_p, quality: ctypes.c_float) -> ctypes.c_bool:
"""
Save an SDL_Surface into a WEBP image file.
"""
[docs]
def IMG_SaveWEBP_IO(surface: LP_SDL_Surface, dst: LP_SDL_IOStream, closeio: ctypes.c_bool, quality: ctypes.c_float) -> ctypes.c_bool:
"""
Save an SDL_Surface into WEBP image data, via an SDL_IOStream.
"""
[docs]
def IMG_LoadAnimation(file: ctypes.c_char_p) -> LP_IMG_Animation:
"""
Load an animation from a file.
"""
[docs]
def IMG_LoadAnimation_IO(src: LP_SDL_IOStream, closeio: ctypes.c_bool) -> LP_IMG_Animation:
"""
Load an animation from an SDL_IOStream.
"""
[docs]
def IMG_LoadAnimationTyped_IO(src: LP_SDL_IOStream, closeio: ctypes.c_bool, type: ctypes.c_char_p) -> LP_IMG_Animation:
"""
Load an animation from an SDL_IOStream.
"""
[docs]
def IMG_LoadANIAnimation_IO(src: LP_SDL_IOStream) -> LP_IMG_Animation:
"""
Load an ANI animation directly from an SDL_IOStream.
"""
[docs]
def IMG_LoadAPNGAnimation_IO(src: LP_SDL_IOStream) -> LP_IMG_Animation:
"""
Load an APNG animation directly from an SDL_IOStream.
"""
[docs]
def IMG_LoadAVIFAnimation_IO(src: LP_SDL_IOStream) -> LP_IMG_Animation:
"""
Load an AVIF animation directly from an SDL_IOStream.
"""
[docs]
def IMG_LoadGIFAnimation_IO(src: LP_SDL_IOStream) -> LP_IMG_Animation:
"""
Load a GIF animation directly.
"""
[docs]
def IMG_LoadWEBPAnimation_IO(src: LP_SDL_IOStream) -> LP_IMG_Animation:
"""
Load a WEBP animation directly.
"""
[docs]
def IMG_SaveAnimation(anim: LP_IMG_Animation, file: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an animation to a file.
"""
[docs]
def IMG_SaveAnimationTyped_IO(anim: LP_IMG_Animation, dst: LP_SDL_IOStream, closeio: ctypes.c_bool, type: ctypes.c_char_p) -> ctypes.c_bool:
"""
Save an animation to an SDL_IOStream.
"""
[docs]
def IMG_SaveANIAnimation_IO(anim: LP_IMG_Animation, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an animation in ANI format to an SDL_IOStream.
"""
[docs]
def IMG_SaveAPNGAnimation_IO(anim: LP_IMG_Animation, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an animation in APNG format to an SDL_IOStream.
"""
[docs]
def IMG_SaveAVIFAnimation_IO(anim: LP_IMG_Animation, dst: LP_SDL_IOStream, closeio: ctypes.c_bool, quality: ctypes.c_int) -> ctypes.c_bool:
"""
Save an animation in AVIF format to an SDL_IOStream.
"""
[docs]
def IMG_SaveGIFAnimation_IO(anim: LP_IMG_Animation, dst: LP_SDL_IOStream, closeio: ctypes.c_bool) -> ctypes.c_bool:
"""
Save an animation in GIF format to an SDL_IOStream.
"""
[docs]
def IMG_SaveWEBPAnimation_IO(anim: LP_IMG_Animation, dst: LP_SDL_IOStream, closeio: ctypes.c_bool, quality: ctypes.c_int) -> ctypes.c_bool:
"""
Save an animation in WEBP format to an SDL_IOStream.
"""
[docs]
def IMG_CreateAnimatedCursor(anim: LP_IMG_Animation, hot_x: ctypes.c_int, hot_y: ctypes.c_int) -> LP_SDL_Cursor:
"""
Create an animated cursor from an animation.
"""
[docs]
def IMG_FreeAnimation(anim: LP_IMG_Animation) -> None:
"""
Dispose of an IMG_Animation and free its resources.
"""
[docs]
def IMG_CreateAnimationEncoder(file: ctypes.c_char_p) -> LP_IMG_AnimationEncoder:
"""
Create an encoder to save a series of images to a file.
"""
[docs]
def IMG_CreateAnimationEncoder_IO(dst: LP_SDL_IOStream, closeio: ctypes.c_bool, type: ctypes.c_char_p) -> LP_IMG_AnimationEncoder:
"""
Create an encoder to save a series of images to an IOStream.
"""
[docs]
def IMG_CreateAnimationEncoderWithProperties(props: SDL_PropertiesID) -> LP_IMG_AnimationEncoder:
"""
Create an animation encoder with the specified properties.
"""
[docs]
def IMG_AddAnimationEncoderFrame(encoder: LP_IMG_AnimationEncoder, surface: LP_SDL_Surface, duration: ctypes.c_uint64) -> ctypes.c_bool:
"""
Add a frame to an animation encoder.
"""
[docs]
def IMG_CloseAnimationEncoder(encoder: LP_IMG_AnimationEncoder) -> ctypes.c_bool:
"""
Close an animation encoder, finishing any encoding.
"""
[docs]
def IMG_CreateAnimationDecoder(file: ctypes.c_char_p) -> LP_IMG_AnimationDecoder:
"""
Create a decoder to read a series of images from a file.
"""
[docs]
def IMG_CreateAnimationDecoder_IO(src: LP_SDL_IOStream, closeio: ctypes.c_bool, type: ctypes.c_char_p) -> LP_IMG_AnimationDecoder:
"""
Create a decoder to read a series of images from an IOStream.
"""
[docs]
def IMG_CreateAnimationDecoderWithProperties(props: SDL_PropertiesID) -> LP_IMG_AnimationDecoder:
"""
Create an animation decoder with the specified properties.
"""
[docs]
def IMG_GetAnimationDecoderProperties(decoder: LP_IMG_AnimationDecoder) -> SDL_PropertiesID:
"""
Get the properties of an animation decoder.
"""
[docs]
def IMG_GetAnimationDecoderFrame(decoder: LP_IMG_AnimationDecoder, frame: LP_LP_SDL_Surface, duration: LP_c_uint64) -> ctypes.c_bool:
"""
Get the next frame in an animation decoder.
"""
[docs]
def IMG_GetAnimationDecoderStatus(decoder: LP_IMG_AnimationDecoder) -> IMG_AnimationDecoderStatus:
"""
Get the decoder status indicating the current state of the decoder.
"""
[docs]
def IMG_ResetAnimationDecoder(decoder: LP_IMG_AnimationDecoder) -> ctypes.c_bool:
"""
Reset an animation decoder.
"""
[docs]
def IMG_CloseAnimationDecoder(decoder: LP_IMG_AnimationDecoder) -> ctypes.c_bool:
"""
Close an animation decoder, finishing any decoding.
"""