stitchaton/vendor/NetVips/Cache.cs

49 lines
1.1 KiB
C#
Raw Permalink Normal View History

2025-07-31 00:17:59 +07:00
using NetVips.Internal;
namespace NetVips;
/// <summary>
/// A class around libvips' operation cache.
/// </summary>
public static class Cache
{
/// <summary>
/// Gets or sets the maximum number of operations libvips keeps in cache.
/// </summary>
public static int Max
{
get => Vips.CacheGetMax();
set => Vips.CacheSetMax(value);
}
/// <summary>
/// Gets or sets the maximum amount of tracked memory allowed.
/// </summary>
public static ulong MaxMem
{
get => Vips.CacheGetMaxMem();
set => Vips.CacheSetMaxMem(value);
}
/// <summary>
/// Gets or sets the maximum amount of tracked files allowed.
/// </summary>
public static int MaxFiles
{
get => Vips.CacheGetMaxFiles();
set => Vips.CacheSetMaxFiles(value);
}
/// <summary>
/// Gets the current number of operations in cache.
/// </summary>
public static int Size => Vips.CacheGetSize();
/// <summary>
/// Enable or disable libvips cache tracing.
/// </summary>
public static bool Trace
{
set => Vips.CacheSetTrace(value);
}
}