mirror of
https://github.com/ahwootech/BRUTAL.git
synced 2026-11-25 20:48:24 +01:00
2691 lines
134 KiB
C#
2691 lines
134 KiB
C#
// <auto-generated/>
|
|
// Generated by Brutal.Sdl.Generate; do not edit by hand.
|
|
#nullable enable
|
|
|
|
namespace Brutal.SdlApi.Image
|
|
{
|
|
public static unsafe partial class SdlImage
|
|
{
|
|
/// <summary>
|
|
/// This function gets the version of the dynamically linked SDL_image library.
|
|
/// </summary>
|
|
/// <returns>SDL_image version.</returns>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
public static int Version() => PInvoke.Version();
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_Load</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="file">a path on the filesystem to load an image from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* Load(string file)
|
|
{
|
|
SdlSurface* result = PInvoke.Load(file);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_Load failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_Load_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadIO(nint src, bool closeio)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadIO(src, closeio ? (byte)1 : (byte)0);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_Load_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadTyped_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="type">
|
|
/// a filename extension that represent this data ("BMP", "GIF",
|
|
/// "PNG", etc).
|
|
/// </param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadTypedIO(nint src, bool closeio, string type)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadTypedIO(src, closeio ? (byte)1 : (byte)0, type);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadTyped_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadTexture</c>. Throws instead of returning a null handle on failure.
|
|
/// </summary>
|
|
/// <param name="renderer">the SDL_Renderer to use to create the texture.</param>
|
|
/// <param name="file">a path on the filesystem to load an image from.</param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlTexture LoadTexture(SdlRenderer renderer, string file)
|
|
{
|
|
SdlTexture result = PInvoke.LoadTexture(renderer, file);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_LoadTexture failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadTexture_IO</c>. Throws instead of returning a null handle on failure.
|
|
/// </summary>
|
|
/// <param name="renderer">the SDL_Renderer to use to create the texture.</param>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlTexture LoadTextureIO(SdlRenderer renderer, nint src, bool closeio)
|
|
{
|
|
SdlTexture result = PInvoke.LoadTextureIO(renderer, src, closeio ? (byte)1 : (byte)0);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_LoadTexture_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadTextureTyped_IO</c>. Throws instead of returning a null handle on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="renderer">the SDL_Renderer to use to create the texture.</param>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="type">
|
|
/// a filename extension that represent this data ("BMP", "GIF",
|
|
/// "PNG", etc).
|
|
/// </param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlTexture LoadTextureTypedIO(SdlRenderer renderer, nint src, bool closeio, string type)
|
|
{
|
|
SdlTexture result = PInvoke.LoadTextureTypedIO(renderer, src, closeio ? (byte)1 : (byte)0, type);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_LoadTextureTyped_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Load an image from a filesystem path into a GPU texture.
|
|
/// </summary>
|
|
/// <param name="device">the SDL_GPUDevice to use to create the GPU texture.</param>
|
|
/// <param name="copy_pass">
|
|
/// the SDL_GPUCopyPass to use to upload the loaded image to
|
|
/// the GPU texture.
|
|
/// </param>
|
|
/// <param name="file">a path on the filesystem to load an image from.</param>
|
|
/// <param name="width">
|
|
/// a pointer filled in with the width of the GPU texture. may be
|
|
/// NULL.
|
|
/// </param>
|
|
/// <param name="height">
|
|
/// a pointer filled in with the width of the GPU texture. may be
|
|
/// NULL.
|
|
/// </param>
|
|
/// <returns>a new GPU texture, or NULL on error.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// An SDL_GPUTexture represents an image in GPU memory, usable by SDL's GPU
|
|
/// API. Regardless of the source format of the image, this function will
|
|
/// create a GPU texture with the format SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM
|
|
/// with no mip levels. It can be bound as a sampled texture from a graphics or
|
|
/// compute pipeline and as a a readonly storage texture in a compute pipeline.
|
|
/// </para>
|
|
/// <para>
|
|
/// There is a separate function to read files from an SDL_IOStream, if you
|
|
/// need an i/o abstraction to provide data from anywhere instead of a simple
|
|
/// filesystem read; that function is IMG_LoadGPUTexture_IO().
|
|
/// </para>
|
|
/// <para>
|
|
/// When done with the returned texture, the app should dispose of it with a
|
|
/// call to SDL_ReleaseGPUTexture().
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadGPUTextureTypedIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadGPUTextureIO"/>
|
|
public static nint LoadGPUTexture(
|
|
SdlGpuDevice device,
|
|
nint copy_pass,
|
|
string file,
|
|
out int width,
|
|
out int height
|
|
)
|
|
{
|
|
width = default;
|
|
height = default;
|
|
fixed (int* widthPtr = &width)
|
|
{
|
|
fixed (int* heightPtr = &height)
|
|
{
|
|
return PInvoke.LoadGPUTexture(device, copy_pass, file, widthPtr, heightPtr);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Load an image from an SDL data source into a GPU texture.
|
|
/// </summary>
|
|
/// <param name="device">the SDL_GPUDevice to use to create the GPU texture.</param>
|
|
/// <param name="copy_pass">
|
|
/// the SDL_GPUCopyPass to use to upload the loaded image to
|
|
/// the GPU texture.
|
|
/// </param>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="width">
|
|
/// a pointer filled in with the width of the GPU texture. may be
|
|
/// NULL.
|
|
/// </param>
|
|
/// <param name="height">
|
|
/// a pointer filled in with the width of the GPU texture. may be
|
|
/// NULL.
|
|
/// </param>
|
|
/// <returns>a new GPU texture, or NULL on error.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// An SDL_GPUTexture represents an image in GPU memory, usable by SDL's GPU
|
|
/// API. Regardless of the source format of the image, this function will
|
|
/// create a GPU texture with the format SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM
|
|
/// with no mip levels. It can be bound as a sampled texture from a graphics or
|
|
/// compute pipeline and as a a readonly storage texture in a compute pipeline.
|
|
/// </para>
|
|
/// <para>
|
|
/// If <c>closeio</c> is true, <c>src</c> will be closed before returning, whether this
|
|
/// function succeeds or not. SDL_image reads everything it needs from <c>src</c>
|
|
/// during this call in any case.
|
|
/// </para>
|
|
/// <para>
|
|
/// There is a separate function to read files from disk without having to deal
|
|
/// with SDL_IOStream: `IMG_LoadGPUTexture(device, copy_pass, "filename.jpg",
|
|
/// width, height) will call this function and manage those details for you,
|
|
/// determining the file type from the filename's extension.
|
|
/// </para>
|
|
/// <para>
|
|
/// There is also IMG_LoadGPUTextureTyped_IO(), which is equivalent to this
|
|
/// function except a file extension (like "BMP", "JPG", etc) can be specified,
|
|
/// in case SDL_image cannot autodetect the file format.
|
|
/// </para>
|
|
/// <para>
|
|
/// When done with the returned texture, the app should dispose of it with a
|
|
/// call to SDL_ReleaseGPUTexture().
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadGPUTexture"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadGPUTextureTypedIO"/>
|
|
public static nint LoadGPUTextureIO(
|
|
SdlGpuDevice device,
|
|
nint copy_pass,
|
|
nint src,
|
|
bool closeio,
|
|
out int width,
|
|
out int height
|
|
)
|
|
{
|
|
width = default;
|
|
height = default;
|
|
fixed (int* widthPtr = &width)
|
|
{
|
|
fixed (int* heightPtr = &height)
|
|
{
|
|
return PInvoke.LoadGPUTextureIO(
|
|
device,
|
|
copy_pass,
|
|
src,
|
|
closeio ? (byte)1 : (byte)0,
|
|
widthPtr,
|
|
heightPtr
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Load an image from an SDL data source into a GPU texture.
|
|
/// </summary>
|
|
/// <param name="device">the SDL_GPUDevice to use to create the GPU texture.</param>
|
|
/// <param name="copy_pass">
|
|
/// the SDL_GPUCopyPass to use to upload the loaded image to
|
|
/// the GPU texture.
|
|
/// </param>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="type">
|
|
/// a filename extension that represent this data ("BMP", "GIF",
|
|
/// "PNG", etc).
|
|
/// </param>
|
|
/// <param name="width">
|
|
/// a pointer filled in with the width of the GPU texture. may be
|
|
/// NULL.
|
|
/// </param>
|
|
/// <param name="height">
|
|
/// a pointer filled in with the width of the GPU texture. may be
|
|
/// NULL.
|
|
/// </param>
|
|
/// <returns>a new GPU texture, or NULL on error.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// An SDL_GPUTexture represents an image in GPU memory, usable by SDL's GPU
|
|
/// API. Regardless of the source format of the image, this function will
|
|
/// create a GPU texture with the format SDL_GPU_TEXTUREFORMAT_R8G8B8A8_UNORM
|
|
/// with no mip levels. It can be bound as a sampled texture from a graphics or
|
|
/// compute pipeline and as a a readonly storage texture in a compute pipeline.
|
|
/// </para>
|
|
/// <para>
|
|
/// If <c>closeio</c> is true, <c>src</c> will be closed before returning, whether this
|
|
/// function succeeds or not. SDL_image reads everything it needs from <c>src</c>
|
|
/// during this call in any case.
|
|
/// </para>
|
|
/// <para>
|
|
/// Even though this function accepts a file type, SDL_image may still try
|
|
/// other decoders that are capable of detecting file type from the contents of
|
|
/// the image data, but may rely on the caller-provided type string for formats
|
|
/// that it cannot autodetect. If <c>type</c> is NULL, SDL_image will rely solely on
|
|
/// its ability to guess the format.
|
|
/// </para>
|
|
/// <para>
|
|
/// There is a separate function to read files from disk without having to deal
|
|
/// with SDL_IOStream: `IMG_LoadGPUTexture(device, copy_pass, "filename.jpg",
|
|
/// width, height) will call this function and manage those details for you,
|
|
/// determining the file type from the filename's extension.
|
|
/// </para>
|
|
/// <para>
|
|
/// There is also IMG_LoadGPUTexture_IO(), which is equivalent to this function
|
|
/// except that it will rely on SDL_image to determine what type of data it is
|
|
/// loading, much like passing a NULL for type.
|
|
/// </para>
|
|
/// <para>
|
|
/// When done with the returned texture, the app should dispose of it with a
|
|
/// call to SDL_ReleaseGPUTexture().
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadGPUTexture"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadGPUTextureIO"/>
|
|
public static nint LoadGPUTextureTypedIO(
|
|
SdlGpuDevice device,
|
|
nint copy_pass,
|
|
nint src,
|
|
bool closeio,
|
|
string type,
|
|
out int width,
|
|
out int height
|
|
)
|
|
{
|
|
width = default;
|
|
height = default;
|
|
fixed (int* widthPtr = &width)
|
|
{
|
|
fixed (int* heightPtr = &height)
|
|
{
|
|
return PInvoke.LoadGPUTextureTypedIO(
|
|
device,
|
|
copy_pass,
|
|
src,
|
|
closeio ? (byte)1 : (byte)0,
|
|
type,
|
|
widthPtr,
|
|
heightPtr
|
|
);
|
|
}
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_GetClipboardImage</c>. Throws instead of returning a null pointer on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* GetClipboardImage()
|
|
{
|
|
SdlSurface* result = PInvoke.GetClipboardImage();
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_GetClipboardImage failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Detect ANI animated cursor data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is ANI animated cursor data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsANI(nint src) => PInvoke.IsANI(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect AVIF image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is AVIF data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsAVIF(nint src) => PInvoke.IsAVIF(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect CUR image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is CUR data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsCUR(nint src) => PInvoke.IsCUR(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect BMP image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is BMP data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsBMP(nint src) => PInvoke.IsBMP(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect GIF image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is GIF data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsGIF(nint src) => PInvoke.IsGIF(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect ICO image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is ICO data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsICO(nint src) => PInvoke.IsICO(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect JPG image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is JPG data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsJPG(nint src) => PInvoke.IsJPG(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect JXL image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is JXL data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsJXL(nint src) => PInvoke.IsJXL(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect LBM image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is LBM data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsLBM(nint src) => PInvoke.IsLBM(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect PCX image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is PCX data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsPCX(nint src) => PInvoke.IsPCX(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect PNG image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is PNG data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsPNG(nint src) => PInvoke.IsPNG(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect PNM image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is PNM data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsPNM(nint src) => PInvoke.IsPNM(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect QOI image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is QOI data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsQOI(nint src) => PInvoke.IsQOI(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect SVG image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is SVG data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsSVG(nint src) => PInvoke.IsSVG(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect TIFF image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is TIFF data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsTIF(nint src) => PInvoke.IsTIF(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect WEBP image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is WEBP data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsWEBP(nint src) => PInvoke.IsWEBP(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect XCF image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is XCF data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsXCF(nint src) => PInvoke.IsXCF(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect XPM image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is XPM data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXV"/>
|
|
public static bool IsXPM(nint src) => PInvoke.IsXPM(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Detect XV image data on a readable/seekable SDL_IOStream.
|
|
/// </summary>
|
|
/// <param name="src">a seekable/readable SDL_IOStream to provide image data.</param>
|
|
/// <returns>true if this is XV data, false otherwise.</returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function attempts to determine if a file is a given filetype, reading
|
|
/// the least amount possible from the SDL_IOStream (usually a few bytes).
|
|
/// </para>
|
|
/// <para>
|
|
/// There is no distinction made between "not the filetype in question" and
|
|
/// basic i/o errors.
|
|
/// </para>
|
|
/// <para>
|
|
/// This function will always attempt to seek <c>src</c> back to where it started
|
|
/// when this function was called, but it will not report any errors in doing
|
|
/// so, but assuming seeking works, this means you can immediately use this
|
|
/// with a different IMG_isTYPE function, or load the image without further
|
|
/// seeking.
|
|
/// </para>
|
|
/// <para>
|
|
/// You do not need to call this function to load data; SDL_image can work to
|
|
/// determine file type in many cases in its standard load functions.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsANI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsAVIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsBMP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsCUR"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsGIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsICO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJPG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsJXL"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsLBM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPCX"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsPNM"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsQOI"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsSVG"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsTIF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsWEBP"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXCF"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.IsXPM"/>
|
|
public static bool IsXV(nint src) => PInvoke.IsXV(src) != 0;
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadAVIF_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadAVIFIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadAVIFIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadAVIF_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadBMP_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadBMPIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadBMPIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadBMP_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadCUR_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadCURIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadCURIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadCUR_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadGIF_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadGIFIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadGIFIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadGIF_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadICO_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadICOIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadICOIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadICO_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadJPG_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadJPGIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadJPGIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadJPG_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadJXL_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadJXLIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadJXLIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadJXL_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadLBM_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadLBMIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadLBMIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadLBM_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadPCX_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadPCXIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadPCXIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadPCX_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadPNG_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadPNGIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadPNGIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadPNG_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadPNM_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadPNMIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadPNMIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadPNM_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadSVG_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadSVGIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadSVGIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadSVG_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadSizedSVG_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load SVG data from.</param>
|
|
/// <param name="width">desired width of the generated surface, in pixels.</param>
|
|
/// <param name="height">desired height of the generated surface, in pixels.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadSizedSVGIO(nint src, int width, int height)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadSizedSVGIO(src, width, height);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadSizedSVG_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadQOI_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadQOIIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadQOIIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadQOI_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadTGA_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadTGAIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadTGAIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadTGA_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadTIF_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadTIFIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadTIFIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadTIF_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadWEBP_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadWEBPIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadWEBPIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadWEBP_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadXCF_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadXCFIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadXCFIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadXCF_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadXPM_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadXPMIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadXPMIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadXPM_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadXV_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream to load image data from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlSurface* LoadXVIO(nint src)
|
|
{
|
|
SdlSurface* result = PInvoke.LoadXVIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadXV_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_Save</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void Save(SdlSurface* surface, string file)
|
|
{
|
|
if (PInvoke.Save(surface, file) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_Save failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveTyped_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="type">
|
|
/// a filename extension that represent this data ("BMP", "GIF",
|
|
/// "PNG", etc).
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveTypedIO(SdlSurface* surface, nint dst, bool closeio, string type)
|
|
{
|
|
if (PInvoke.SaveTypedIO(surface, dst, closeio ? (byte)1 : (byte)0, type) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveTyped_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveAVIF</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <param name="quality">
|
|
/// the desired quality, ranging between 0 (lowest) and 100
|
|
/// (highest).
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveAVIF(SdlSurface* surface, string file, int quality)
|
|
{
|
|
if (PInvoke.SaveAVIF(surface, file, quality) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveAVIF failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveAVIF_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="quality">
|
|
/// the desired quality, ranging between 0 (lowest) and 100
|
|
/// (highest).
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveAVIFIO(SdlSurface* surface, nint dst, bool closeio, int quality)
|
|
{
|
|
if (PInvoke.SaveAVIFIO(surface, dst, closeio ? (byte)1 : (byte)0, quality) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveAVIF_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveBMP</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveBMP(SdlSurface* surface, string file)
|
|
{
|
|
if (PInvoke.SaveBMP(surface, file) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveBMP failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveBMP_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveBMPIO(SdlSurface* surface, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SaveBMPIO(surface, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveBMP_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveCUR</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveCUR(SdlSurface* surface, string file)
|
|
{
|
|
if (PInvoke.SaveCUR(surface, file) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveCUR failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveCUR_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveCURIO(SdlSurface* surface, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SaveCURIO(surface, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveCUR_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveGIF</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveGIF(SdlSurface* surface, string file)
|
|
{
|
|
if (PInvoke.SaveGIF(surface, file) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveGIF failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveGIF_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveGIFIO(SdlSurface* surface, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SaveGIFIO(surface, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveGIF_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveICO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveICO(SdlSurface* surface, string file)
|
|
{
|
|
if (PInvoke.SaveICO(surface, file) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveICO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveICO_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveICOIO(SdlSurface* surface, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SaveICOIO(surface, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveICO_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveJPG</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <param name="quality">
|
|
/// [0; 33] is Lowest quality, [34; 66] is Middle quality, [67;
|
|
/// 100] is Highest quality.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveJPG(SdlSurface* surface, string file, int quality)
|
|
{
|
|
if (PInvoke.SaveJPG(surface, file, quality) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveJPG failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveJPG_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="quality">
|
|
/// [0; 33] is Lowest quality, [34; 66] is Middle quality, [67;
|
|
/// 100] is Highest quality.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveJPGIO(SdlSurface* surface, nint dst, bool closeio, int quality)
|
|
{
|
|
if (PInvoke.SaveJPGIO(surface, dst, closeio ? (byte)1 : (byte)0, quality) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveJPG_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SavePNG</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SavePNG(SdlSurface* surface, string file)
|
|
{
|
|
if (PInvoke.SavePNG(surface, file) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SavePNG failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SavePNG_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SavePNGIO(SdlSurface* surface, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SavePNGIO(surface, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SavePNG_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveTGA</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write new file to.</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveTGA(SdlSurface* surface, string file)
|
|
{
|
|
if (PInvoke.SaveTGA(surface, file) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveTGA failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveTGA_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveTGAIO(SdlSurface* surface, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SaveTGAIO(surface, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveTGA_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveWEBP</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="file">path on the filesystem to write the new file to.</param>
|
|
/// <param name="quality">
|
|
/// between 0 and 100. For lossy, 0 gives the smallest size and
|
|
/// 100 the largest. For lossless, this parameter is the amount
|
|
/// of effort put into the compression: 0 is the fastest but
|
|
/// gives larger files compared to the slowest, but best, 100.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveWEBP(SdlSurface* surface, string file, float quality)
|
|
{
|
|
if (PInvoke.SaveWEBP(surface, file, quality) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveWEBP failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveWEBP_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="surface">the SDL surface to save.</param>
|
|
/// <param name="dst">the SDL_IOStream to save the image data to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="quality">
|
|
/// between 0 and 100. For lossy, 0 gives the smallest size and
|
|
/// 100 the largest. For lossless, this parameter is the amount
|
|
/// of effort put into the compression: 0 is the fastest but
|
|
/// gives larger files compared to the slowest, but best, 100.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveWEBPIO(SdlSurface* surface, nint dst, bool closeio, float quality)
|
|
{
|
|
if (PInvoke.SaveWEBPIO(surface, dst, closeio ? (byte)1 : (byte)0, quality) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveWEBP_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadAnimation</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="file">path on the filesystem containing an animated image.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimation* LoadAnimation(string file)
|
|
{
|
|
ImgAnimation* result = PInvoke.LoadAnimation(file);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadAnimation failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadAnimation_IO</c>. Throws instead of returning a null pointer on failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimation* LoadAnimationIO(nint src, bool closeio)
|
|
{
|
|
ImgAnimation* result = PInvoke.LoadAnimationIO(src, closeio ? (byte)1 : (byte)0);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadAnimation_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadAnimationTyped_IO</c>. Throws instead of returning a null pointer on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="type">a filename extension that represent this data ("GIF", etc).</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimation* LoadAnimationTypedIO(nint src, bool closeio, string type)
|
|
{
|
|
ImgAnimation* result = PInvoke.LoadAnimationTypedIO(src, closeio ? (byte)1 : (byte)0, type);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadAnimationTyped_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadANIAnimation_IO</c>. Throws instead of returning a null pointer on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream from which data will be read.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimation* LoadANIAnimationIO(nint src)
|
|
{
|
|
ImgAnimation* result = PInvoke.LoadANIAnimationIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadANIAnimation_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadAPNGAnimation_IO</c>. Throws instead of returning a null pointer on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream from which data will be read.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimation* LoadAPNGAnimationIO(nint src)
|
|
{
|
|
ImgAnimation* result = PInvoke.LoadAPNGAnimationIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadAPNGAnimation_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadAVIFAnimation_IO</c>. Throws instead of returning a null pointer on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimation* LoadAVIFAnimationIO(nint src)
|
|
{
|
|
ImgAnimation* result = PInvoke.LoadAVIFAnimationIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadAVIFAnimation_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadGIFAnimation_IO</c>. Throws instead of returning a null pointer on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimation* LoadGIFAnimationIO(nint src)
|
|
{
|
|
ImgAnimation* result = PInvoke.LoadGIFAnimationIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadGIFAnimation_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_LoadWEBPAnimation_IO</c>. Throws instead of returning a null pointer on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream that data will be read from.</param>
|
|
/// <returns>The created resource (never null); the caller owns it and is responsible for freeing it.</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimation* LoadWEBPAnimationIO(nint src)
|
|
{
|
|
ImgAnimation* result = PInvoke.LoadWEBPAnimationIO(src);
|
|
if (result == null)
|
|
{
|
|
throw SdlException.FromError("IMG_LoadWEBPAnimation_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveAnimation</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="anim">the animation to save.</param>
|
|
/// <param name="file">path on the filesystem containing an animated image.</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveAnimation(ImgAnimation* anim, string file)
|
|
{
|
|
if (PInvoke.SaveAnimation(anim, file) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveAnimation failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveAnimationTyped_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="anim">the animation to save.</param>
|
|
/// <param name="dst">an SDL_IOStream that data will be written to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="type">a filename extension that represent this data ("GIF", etc).</param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveAnimationTypedIO(ImgAnimation* anim, nint dst, bool closeio, string type)
|
|
{
|
|
if (PInvoke.SaveAnimationTypedIO(anim, dst, closeio ? (byte)1 : (byte)0, type) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveAnimationTyped_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveANIAnimation_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="anim">the animation to save.</param>
|
|
/// <param name="dst">an SDL_IOStream from which data will be written to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveANIAnimationIO(ImgAnimation* anim, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SaveANIAnimationIO(anim, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveANIAnimation_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveAPNGAnimation_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="anim">the animation to save.</param>
|
|
/// <param name="dst">an SDL_IOStream from which data will be written to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveAPNGAnimationIO(ImgAnimation* anim, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SaveAPNGAnimationIO(anim, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveAPNGAnimation_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveAVIFAnimation_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="anim">the animation to save.</param>
|
|
/// <param name="dst">an SDL_IOStream from which data will be written to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="quality">
|
|
/// the desired quality, ranging between 0 (lowest) and 100
|
|
/// (highest).
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveAVIFAnimationIO(ImgAnimation* anim, nint dst, bool closeio, int quality)
|
|
{
|
|
if (PInvoke.SaveAVIFAnimationIO(anim, dst, closeio ? (byte)1 : (byte)0, quality) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveAVIFAnimation_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveGIFAnimation_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="anim">the animation to save.</param>
|
|
/// <param name="dst">an SDL_IOStream from which data will be written to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveGIFAnimationIO(ImgAnimation* anim, nint dst, bool closeio)
|
|
{
|
|
if (PInvoke.SaveGIFAnimationIO(anim, dst, closeio ? (byte)1 : (byte)0) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveGIFAnimation_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_SaveWEBPAnimation_IO</c>. Throws instead of returning false on failure.
|
|
/// </summary>
|
|
/// <param name="anim">the animation to save.</param>
|
|
/// <param name="dst">an SDL_IOStream from which data will be written to.</param>
|
|
/// <param name="closeio">
|
|
/// true to close/free the SDL_IOStream before returning, false
|
|
/// to leave it open.
|
|
/// </param>
|
|
/// <param name="quality">
|
|
/// between 0 and 100. For lossy, 0 gives the smallest size and
|
|
/// 100 the largest. For lossless, this parameter is the amount
|
|
/// of effort put into the compression: 0 is the fastest but
|
|
/// gives larger files compared to the slowest, but best, 100.
|
|
/// </param>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static void SaveWEBPAnimationIO(ImgAnimation* anim, nint dst, bool closeio, int quality)
|
|
{
|
|
if (PInvoke.SaveWEBPAnimationIO(anim, dst, closeio ? (byte)1 : (byte)0, quality) == 0)
|
|
{
|
|
throw SdlException.FromError("IMG_SaveWEBPAnimation_IO failed");
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_CreateAnimatedCursor</c>. Throws instead of returning a null handle on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="anim">an animation to use to create an animated cursor.</param>
|
|
/// <param name="hot_x">the x position of the cursor hot spot.</param>
|
|
/// <param name="hot_y">the y position of the cursor hot spot.</param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static SdlCursor CreateAnimatedCursor(ImgAnimation* anim, int hot_x, int hot_y)
|
|
{
|
|
SdlCursor result = PInvoke.CreateAnimatedCursor(anim, hot_x, hot_y);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_CreateAnimatedCursor failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Dispose of an IMG_Animation and free its resources.
|
|
/// </summary>
|
|
/// <param name="anim">IMG_Animation to dispose of.</param>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// The provided <c>anim</c> pointer is not valid once this call returns.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.0.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadAnimation"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadAnimationIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadAnimationTypedIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadANIAnimationIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadAPNGAnimationIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadAVIFAnimationIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadGIFAnimationIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.LoadWEBPAnimationIO"/>
|
|
public static void FreeAnimation(ImgAnimation* anim) => PInvoke.FreeAnimation(anim);
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_CreateAnimationEncoder</c>. Throws instead of returning a null handle on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="file">the file where the animation will be saved.</param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimationEncoder CreateAnimationEncoder(string file)
|
|
{
|
|
ImgAnimationEncoder result = PInvoke.CreateAnimationEncoder(file);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_CreateAnimationEncoder failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_CreateAnimationEncoder_IO</c>. Throws instead of returning a null handle on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="dst">an SDL_IOStream that will be used to save the stream.</param>
|
|
/// <param name="closeio">
|
|
/// true to close the SDL_IOStream when done, false to leave it
|
|
/// open.
|
|
/// </param>
|
|
/// <param name="type">a filename extension that represent this data ("WEBP", etc).</param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimationEncoder CreateAnimationEncoderIO(nint dst, bool closeio, string type)
|
|
{
|
|
ImgAnimationEncoder result = PInvoke.CreateAnimationEncoderIO(dst, closeio ? (byte)1 : (byte)0, type);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_CreateAnimationEncoder_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_CreateAnimationEncoderWithProperties</c>. Throws instead of returning a null
|
|
/// handle on failure.
|
|
/// </summary>
|
|
/// <param name="props">the properties of the animation encoder.</param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimationEncoder CreateAnimationEncoderWithProperties(uint props)
|
|
{
|
|
ImgAnimationEncoder result = PInvoke.CreateAnimationEncoderWithProperties(props);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_CreateAnimationEncoderWithProperties failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Add a frame to an animation encoder.
|
|
/// </summary>
|
|
/// <param name="encoder">the receiving images.</param>
|
|
/// <param name="surface">the surface to add as the next frame in the animation.</param>
|
|
/// <param name="duration">
|
|
/// the duration of the frame, usually in milliseconds but can
|
|
/// be other units if the
|
|
/// <c>IMG_PROP_ANIMATION_ENCODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER</c>
|
|
/// property is set when creating the encoder.
|
|
/// </param>
|
|
/// <returns>
|
|
/// true on success or false on failure; call SDL_GetError() for more
|
|
/// information.
|
|
/// </returns>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationEncoder"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationEncoderIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationEncoderWithProperties"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CloseAnimationEncoder"/>
|
|
public static bool AddAnimationEncoderFrame(ImgAnimationEncoder encoder, SdlSurface* surface, ulong duration) =>
|
|
PInvoke.AddAnimationEncoderFrame(encoder, surface, duration) != 0;
|
|
|
|
/// <summary>
|
|
/// Close an animation encoder, finishing any encoding.
|
|
/// </summary>
|
|
/// <param name="encoder">the encoder to close.</param>
|
|
/// <returns>
|
|
/// true on success or false on failure; call SDL_GetError() for more
|
|
/// information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Calling this function frees the animation encoder, and returns the final
|
|
/// status of the encoding process.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationEncoder"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationEncoderIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationEncoderWithProperties"/>
|
|
public static bool CloseAnimationEncoder(ImgAnimationEncoder encoder) =>
|
|
PInvoke.CloseAnimationEncoder(encoder) != 0;
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_CreateAnimationDecoder</c>. Throws instead of returning a null handle on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="file">the file containing a series of images.</param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimationDecoder CreateAnimationDecoder(string file)
|
|
{
|
|
ImgAnimationDecoder result = PInvoke.CreateAnimationDecoder(file);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_CreateAnimationDecoder failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_CreateAnimationDecoder_IO</c>. Throws instead of returning a null handle on
|
|
/// failure.
|
|
/// </summary>
|
|
/// <param name="src">an SDL_IOStream containing a series of images.</param>
|
|
/// <param name="closeio">
|
|
/// true to close the SDL_IOStream when done, false to leave it
|
|
/// open.
|
|
/// </param>
|
|
/// <param name="type">a filename extension that represent this data ("WEBP", etc).</param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimationDecoder CreateAnimationDecoderIO(nint src, bool closeio, string type)
|
|
{
|
|
ImgAnimationDecoder result = PInvoke.CreateAnimationDecoderIO(src, closeio ? (byte)1 : (byte)0, type);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_CreateAnimationDecoder_IO failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Ergonomic wrapper over <c>IMG_CreateAnimationDecoderWithProperties</c>. Throws instead of returning a null
|
|
/// handle on failure.
|
|
/// </summary>
|
|
/// <param name="props">the properties of the animation decoder.</param>
|
|
/// <returns>The created handle (never a null handle).</returns>
|
|
/// <exception cref="SdlException">The SDL call failed; the message carries the <c>SDL_GetError</c>
|
|
/// text.</exception>
|
|
public static ImgAnimationDecoder CreateAnimationDecoderWithProperties(uint props)
|
|
{
|
|
ImgAnimationDecoder result = PInvoke.CreateAnimationDecoderWithProperties(props);
|
|
if (result.IsNull())
|
|
{
|
|
throw SdlException.FromError("IMG_CreateAnimationDecoderWithProperties failed");
|
|
}
|
|
return result;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the properties of an animation decoder.
|
|
/// </summary>
|
|
/// <param name="decoder">the animation decoder.</param>
|
|
/// <returns>
|
|
/// the properties ID of the animation decoder, or 0 if there are no
|
|
/// properties; call SDL_GetError() for more information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function returns the properties of the animation decoder, which holds
|
|
/// information about the underlying image such as description, copyright text
|
|
/// and loop count.
|
|
/// </para>
|
|
/// <para>
|
|
/// <c>IMG_PROP_METADATA_LOOP_COUNT_NUMBER</c>, if present, specifies the number of times to play the
|
|
/// animation, with 0 meaning loop continuously.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoder"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoderIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoderWithProperties"/>
|
|
public static uint GetAnimationDecoderProperties(ImgAnimationDecoder decoder) =>
|
|
PInvoke.GetAnimationDecoderProperties(decoder);
|
|
|
|
/// <summary>
|
|
/// Get the next frame in an animation decoder.
|
|
/// </summary>
|
|
/// <param name="decoder">the animation decoder.</param>
|
|
/// <param name="frame">
|
|
/// a pointer filled in with the SDL_Surface for the next frame in
|
|
/// the animation.
|
|
/// </param>
|
|
/// <param name="duration">
|
|
/// the duration of the frame, usually in milliseconds but can
|
|
/// be other units if the
|
|
/// <c>IMG_PROP_ANIMATION_DECODER_CREATE_TIMEBASE_DENOMINATOR_NUMBER</c>
|
|
/// property is set when creating the decoder.
|
|
/// </param>
|
|
/// <returns>
|
|
/// true on success or false on failure and when no more frames are
|
|
/// available; call IMG_GetAnimationDecoderStatus() or SDL_GetError()
|
|
/// for more information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// This function decodes the next frame in the animation decoder, returning it
|
|
/// as an SDL_Surface. The returned surface should be freed with
|
|
/// SDL_FreeSurface() when no longer needed.
|
|
/// </para>
|
|
/// <para>
|
|
/// If the animation decoder has no more frames or an error occurred while
|
|
/// decoding the frame, this function returns false. In that case, please call
|
|
/// SDL_GetError() for more information. If SDL_GetError() returns an empty
|
|
/// string, that means there are no more available frames. If SDL_GetError()
|
|
/// returns a valid string, that means the decoding failed.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoder"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoderIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoderWithProperties"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.GetAnimationDecoderStatus"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.ResetAnimationDecoder"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CloseAnimationDecoder"/>
|
|
public static bool GetAnimationDecoderFrame(ImgAnimationDecoder decoder, SdlSurface** frame, out ulong duration)
|
|
{
|
|
duration = default;
|
|
fixed (ulong* durationPtr = &duration)
|
|
{
|
|
return PInvoke.GetAnimationDecoderFrame(decoder, frame, durationPtr) != 0;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Get the decoder status indicating the current state of the decoder.
|
|
/// </summary>
|
|
/// <param name="decoder">the decoder to get the status of.</param>
|
|
/// <returns>
|
|
/// the status of the underlying decoder, or
|
|
/// IMG_DECODER_STATUS_INVALID if the given decoder is invalid.
|
|
/// </returns>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.GetAnimationDecoderFrame"/>
|
|
public static ImgAnimationDecoderStatus GetAnimationDecoderStatus(ImgAnimationDecoder decoder) =>
|
|
PInvoke.GetAnimationDecoderStatus(decoder);
|
|
|
|
/// <summary>
|
|
/// Reset an animation decoder.
|
|
/// </summary>
|
|
/// <param name="decoder">the decoder to reset.</param>
|
|
/// <returns>
|
|
/// true on success or false on failure; call SDL_GetError() for more
|
|
/// information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Calling this function resets the animation decoder, allowing it to start
|
|
/// from the beginning again. This is useful if you want to decode the frame
|
|
/// sequence again without creating a new decoder.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoder"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoderIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoderWithProperties"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.GetAnimationDecoderFrame"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CloseAnimationDecoder"/>
|
|
public static bool ResetAnimationDecoder(ImgAnimationDecoder decoder) =>
|
|
PInvoke.ResetAnimationDecoder(decoder) != 0;
|
|
|
|
/// <summary>
|
|
/// Close an animation decoder, finishing any decoding.
|
|
/// </summary>
|
|
/// <param name="decoder">the decoder to close.</param>
|
|
/// <returns>
|
|
/// true on success or false on failure; call SDL_GetError() for more
|
|
/// information.
|
|
/// </returns>
|
|
/// <remarks>
|
|
/// <para>
|
|
/// Calling this function frees the animation decoder, and returns the final
|
|
/// status of the decoding process.
|
|
/// </para>
|
|
/// </remarks>
|
|
/// <since>
|
|
/// This function is available since SDL_image 3.4.0.
|
|
/// </since>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoder"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoderIO"/>
|
|
/// <seealso cref="Brutal.SdlApi.Image.SdlImage.PInvoke.CreateAnimationDecoderWithProperties"/>
|
|
public static bool CloseAnimationDecoder(ImgAnimationDecoder decoder) =>
|
|
PInvoke.CloseAnimationDecoder(decoder) != 0;
|
|
}
|
|
}
|