Unit sdl2_image

Uses
Classes, Interfaces, Objects and Records
Variables

Description

 

Overview

Functions and Procedures

function IMG_GetError: PAnsiChar; cdecl; external SDL_LibName name '_SDL_GetError';
function IMG_Init(flags: cint32): cint32 cdecl; external IMG_LibName;
function IMG_isBMP(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isCUR(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isGIF(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isICO(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isJPG(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isLBM(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isPCX(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isPNG(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isPNM(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isSVG(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isTIF(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isWEBP(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isXCF(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isXPM(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_isXV(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
function IMG_Linked_Version: PSDL_Version cdecl; external IMG_LibName;
function IMG_Load(_file: PAnsiChar): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadBMP_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadCUR_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadGIF_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadICO_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadJPG_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadLBM_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadPCX_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadPNG_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadPNM_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadSVG_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadTexture(renderer: PSDL_Renderer; _file: PAnsiChar): PSDL_Texture cdecl; external IMG_LibName;
function IMG_LoadTextureTyped_RW(renderer: PSDL_Renderer; src: PSDL_RWops; freesrc: cint32; _type: PAnsiChar): PSDL_Texture cdecl; external IMG_LibName;
function IMG_LoadTexture_RW(renderer: PSDL_Renderer; src: PSDL_RWops; freesrc: cint32): PSDL_Texture cdecl; external IMG_LibName;
function IMG_LoadTGA_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadTIF_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadTyped_RW(src: PSDL_RWops; freesrc: cint32; _type: PAnsiChar): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadWEBP_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadXCF_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadXPM_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_LoadXV_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
function IMG_Load_RW(src: PSDL_RWops; freesrc: cint32): PSDL_Surface cdecl; external IMG_LibName;
procedure IMG_Quit() cdecl; external IMG_LibName;
function IMG_ReadXPMFromArray(xpm: PPChar): PSDL_Surface cdecl; external IMG_LibName;
function IMG_SaveJPG(surface: PSDL_Surface; const _file: PAnsiChar; quality: cint32): cint32 cdecl; external IMG_LibName;
function IMG_SaveJPG_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: cint32; quality: cint32): cint32 cdecl; external IMG_LibName;
function IMG_SavePNG(surface: PSDL_Surface; const _file: PAnsiChar): cint32 cdecl; external IMG_LibName;
function IMG_SavePNG_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: cint32): cint32 cdecl; external IMG_LibName;
function IMG_SetError(fmt: PAnsiChar; args: array of const): cint; cdecl; external SDL_LibName name '_SDL_SetError';
procedure SDL_IMAGE_VERSION(Out X: TSDL_Version);

Types

cintptr_t = PtrInt;
cuintptr_t = PtrUInt;
PIMG_InitFlags = ˆTIMG_InitFlags;
ppcuint8 = ˆpcuint8;
PPIMG_InitFlags = ˆPIMG_InitFlags;
PPUInt8Array = ˆPUInt8Array;
PUInt8Array = ˆTUInt8Array;
TIMG_InitFlags = DWord;
TUInt8Array = array [0..MAXINT shr 1] of cuint8;

Constants

IMG_INIT_JPG = $00000001;
IMG_INIT_PNG = $00000002;
IMG_INIT_TIF = $00000004;
IMG_INIT_WEBP = $00000008;
SDL_IMAGE_MAJOR_VERSION = 2;
SDL_IMAGE_MINOR_VERSION = 0;
SDL_IMAGE_PATCHLEVEL = 5;

Description

Functions and Procedures

function IMG_GetError: PAnsiChar; cdecl; external SDL_LibName name '_SDL_GetError';
 
function IMG_Init(flags: cint32): cint32 cdecl; external IMG_LibName;

Loads dynamic libraries and prepares them for use. Flags should be one or more flags from IMG_InitFlags OR'd together. It returns the flags successfully initialized, or 0 on failure.

function IMG_isBMP(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isCUR(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isGIF(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isICO(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;

Functions to detect a file type, given a seekable source *

function IMG_isJPG(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isLBM(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isPCX(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isPNG(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isPNM(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isSVG(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isTIF(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isWEBP(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isXCF(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isXPM(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_isXV(src: PSDL_RWops): cint32 cdecl; external IMG_LibName;
 
function IMG_Linked_Version: PSDL_Version cdecl; external IMG_LibName;

This function gets the version of the dynamically linked SDL_image library.

Note that this function does NOT allocate a new TSDL_Version and fill it with info, but returns a pointer to a TSDL_Version residing inside dynlinked file.

As such, attempting to Dispose() of this memory will result in access violation.

function IMG_Load(_file: PAnsiChar): PSDL_Surface cdecl; external IMG_LibName;

Convenience functions *

function IMG_LoadBMP_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadCUR_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadGIF_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadICO_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;

Individual loading functions *

function IMG_LoadJPG_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadLBM_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadPCX_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadPNG_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadPNM_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadSVG_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadTexture(renderer: PSDL_Renderer; _file: PAnsiChar): PSDL_Texture cdecl; external IMG_LibName;

Load an image directly into a render texture. *

function IMG_LoadTextureTyped_RW(renderer: PSDL_Renderer; src: PSDL_RWops; freesrc: cint32; _type: PAnsiChar): PSDL_Texture cdecl; external IMG_LibName;
 
function IMG_LoadTexture_RW(renderer: PSDL_Renderer; src: PSDL_RWops; freesrc: cint32): PSDL_Texture cdecl; external IMG_LibName;
 
function IMG_LoadTGA_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadTIF_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadTyped_RW(src: PSDL_RWops; freesrc: cint32; _type: PAnsiChar): PSDL_Surface cdecl; external IMG_LibName;

Load an image from an SDL data source. The 'type' may be one of: "BMP", "GIF", "PNG", etc.

If the image format supports a transparent pixel, SDL will set the colorkey for the surface. You can enable RLE acceleration on the surface afterwards by calling: SDL_SetColorKey(image, SDL_RLEACCEL, image->format->colorkey);

function IMG_LoadWEBP_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadXCF_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadXPM_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_LoadXV_RW(src: PSDL_RWops): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_Load_RW(src: PSDL_RWops; freesrc: cint32): PSDL_Surface cdecl; external IMG_LibName;
 
procedure IMG_Quit() cdecl; external IMG_LibName;

Unloads libraries loaded with IMG_Init *

function IMG_ReadXPMFromArray(xpm: PPChar): PSDL_Surface cdecl; external IMG_LibName;
 
function IMG_SaveJPG(surface: PSDL_Surface; const _file: PAnsiChar; quality: cint32): cint32 cdecl; external IMG_LibName;
 
function IMG_SaveJPG_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: cint32; quality: cint32): cint32 cdecl; external IMG_LibName;
 
function IMG_SavePNG(surface: PSDL_Surface; const _file: PAnsiChar): cint32 cdecl; external IMG_LibName;

Individual saving functions *

function IMG_SavePNG_RW(surface: PSDL_Surface; dst: PSDL_RWops; freedst: cint32): cint32 cdecl; external IMG_LibName;
 
function IMG_SetError(fmt: PAnsiChar; args: array of const): cint; cdecl; external SDL_LibName name '_SDL_SetError';

We'll use SDL for reporting errors *

procedure SDL_IMAGE_VERSION(Out X: TSDL_Version);

This macro can be used to fill a version structure with the compile-time version of the SDL_image library.

Types

cintptr_t = PtrInt;
 
cuintptr_t = PtrUInt;

"The following type designates an unsigned integer type [or signed respectivly] with the property that any valid pointer to void can be converted to this type, then converted back to a pointer to void, and the result will compare equal to the original pointer: uintptr_t" Source: https://pubs.opengroup.org/onlinepubs/000095399/basedefs/stdint.h.html

PIMG_InitFlags = ˆTIMG_InitFlags;
 
ppcuint8 = ˆpcuint8;
 
PPIMG_InitFlags = ˆPIMG_InitFlags;
 
PPUInt8Array = ˆPUInt8Array;

Data types for all compilers

PUInt8Array = ˆTUInt8Array;
 
TIMG_InitFlags = DWord;
 
TUInt8Array = array [0..MAXINT shr 1] of cuint8;
 

Constants

IMG_INIT_JPG = $00000001;
 
IMG_INIT_PNG = $00000002;
 
IMG_INIT_TIF = $00000004;
 
IMG_INIT_WEBP = $00000008;
 
SDL_IMAGE_MAJOR_VERSION = 2;

Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL *

SDL_IMAGE_MINOR_VERSION = 0;
 
SDL_IMAGE_PATCHLEVEL = 5;
 

Generated by PasDoc 0.16.0.