vendoring NetVips

This commit is contained in:
Renjaya Raga Zenta 2025-07-31 00:17:59 +07:00
parent 36a0f8d39c
commit 33e9d5f43a
41 changed files with 21749 additions and 0 deletions

74
vendor/NetVips/VipsProgress.cs vendored Normal file
View file

@ -0,0 +1,74 @@
using System.Runtime.InteropServices;
namespace NetVips;
/// <summary>
/// Records a start time, and counts microseconds elapsed since that time.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct GTimer
{
/// <summary>
/// Monotonic start time, in microseconds.
/// </summary>
public ulong Start;
/// <summary>
/// Monotonic end time, in microseconds.
/// </summary>
public ulong End;
/// <summary>
/// Is the timer currently active?
/// </summary>
[MarshalAs(UnmanagedType.I1)]
public bool Active;
}
/// <summary>
/// Struct we keep a record of execution time in. Passed to eval signal so
/// it can assess progress.
/// </summary>
[StructLayout(LayoutKind.Sequential)]
public struct VipsProgress
{
/// <summary>
/// Image we are part of.
/// </summary>
private nint Im;
/// <summary>
/// Time we have been running.
/// </summary>
public int Run;
/// <summary>
/// Estimated seconds of computation left.
/// </summary>
public int Eta;
/// <summary>
/// Number of pels we expect to calculate.
/// </summary>
public long TPels;
/// <summary>
/// Number of pels calculated so far.
/// </summary>
public long NPels;
/// <summary>
/// Percent complete.
/// </summary>
public int Percent;
/// <summary>
/// Start time.
/// </summary>
private nint StartPtr;
/// <summary>
/// Start time.
/// </summary>
public GTimer Start => Marshal.PtrToStructure<GTimer>(StartPtr);
}