// ------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------

namespace Win32.Graphics.Imaging;

/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode"]/*' />
/// <unmanaged>IWICBitmapFrameEncode</unmanaged>
[Guid("00000105-a8f2-4877-ba0a-fd2b6645fb94")]
[NativeTypeName("struct IWICBitmapFrameEncode : IUnknown")]
[NativeInheritance("IUnknown")]
public unsafe partial struct IWICBitmapFrameEncode : IWICBitmapFrameEncode.Interface, INativeGuid
{
	public static ref readonly Guid IID_IWICBitmapFrameEncode
	{
		[MethodImpl(MethodImplOptions.AggressiveInlining)]
		get
		{
			ReadOnlySpan<byte> data = new byte[] {
				0x05, 0x01, 0x00, 0x00,
				0xF2, 0xA8,
				0x77, 0x48,
				0xBA,
				0x0A,
				0xFD,
				0x2B,
				0x66,
				0x45,
				0xFB,
				0x94
			};

			Debug.Assert(data.Length == Unsafe.SizeOf<Guid>());
			return ref Unsafe.As<byte, Guid>(ref MemoryMarshal.GetReference(data));
		}
	}

#if NET6_0_OR_GREATER
	static Guid* INativeGuid.NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IWICBitmapFrameEncode));
#else
	public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IWICBitmapFrameEncode));
#endif

	public void** lpVtbl;

	/// <inheritdoc cref="IUnknown.QueryInterface" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(0)]
	public HResult QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, Guid*, void**, int>)(lpVtbl[0]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), riid, ppvObject);
	}

	/// <inheritdoc cref="IUnknown.AddRef" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(1)]
	[return: NativeTypeName("ULONG")]
	public uint AddRef()
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, uint>)(lpVtbl[1]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this));
	}

	/// <inheritdoc cref="IUnknown.Release" />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(2)]
	[return: NativeTypeName("ULONG")]
	public uint Release()
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, uint>)(lpVtbl[2]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this));
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::Initialize"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(3)]
	public HResult Initialize(Com.IPropertyBag2* pIEncoderOptions)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, Com.IPropertyBag2*, int>)(lpVtbl[3]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), pIEncoderOptions);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::SetSize"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(4)]
	public HResult SetSize(uint uiWidth, uint uiHeight)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, uint, uint, int>)(lpVtbl[4]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), uiWidth, uiHeight);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::SetResolution"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(5)]
	public HResult SetResolution(double dpiX, double dpiY)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, double, double, int>)(lpVtbl[5]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), dpiX, dpiY);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::SetPixelFormat"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(6)]
	public HResult SetPixelFormat(Guid* pPixelFormat)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, Guid*, int>)(lpVtbl[6]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), pPixelFormat);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::SetColorContexts"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(7)]
	public HResult SetColorContexts(uint cCount, IWICColorContext** ppIColorContext)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, uint, IWICColorContext**, int>)(lpVtbl[7]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), cCount, ppIColorContext);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::SetPalette"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(8)]
	public HResult SetPalette(IWICPalette* pIPalette)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, IWICPalette*, int>)(lpVtbl[8]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), pIPalette);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::SetThumbnail"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(9)]
	public HResult SetThumbnail(IWICBitmapSource* pIThumbnail)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, IWICBitmapSource*, int>)(lpVtbl[9]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), pIThumbnail);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::WritePixels"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(10)]
	public HResult WritePixels(uint lineCount, uint cbStride, uint cbBufferSize, byte* pbPixels)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, uint, uint, uint, byte*, int>)(lpVtbl[10]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), lineCount, cbStride, cbBufferSize, pbPixels);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::WriteSource"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(11)]
	public HResult WriteSource(IWICBitmapSource* pIBitmapSource, System.Drawing.Rectangle* prc)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, IWICBitmapSource*, System.Drawing.Rectangle*, int>)(lpVtbl[11]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), pIBitmapSource, prc);
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::Commit"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(12)]
	public HResult Commit()
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, int>)(lpVtbl[12]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this));
	}

	/// <include file='../Imaging.xml' path='doc/member[@name="IWICBitmapFrameEncode::GetMetadataQueryWriter"]/*' />
	[MethodImpl(MethodImplOptions.AggressiveInlining)]
	[VtblIndex(13)]
	public HResult GetMetadataQueryWriter(IWICMetadataQueryWriter** ppIMetadataQueryWriter)
	{
		return ((delegate* unmanaged[Stdcall]<IWICBitmapFrameEncode*, IWICMetadataQueryWriter**, int>)(lpVtbl[13]))((IWICBitmapFrameEncode*)Unsafe.AsPointer(ref this), ppIMetadataQueryWriter);
	}
	public interface Interface : IUnknown.Interface
	{
		[VtblIndex(3)]
		HResult Initialize(Com.IPropertyBag2* pIEncoderOptions);

		[VtblIndex(4)]
		HResult SetSize(uint uiWidth, uint uiHeight);

		[VtblIndex(5)]
		HResult SetResolution(double dpiX, double dpiY);

		[VtblIndex(6)]
		HResult SetPixelFormat(Guid* pPixelFormat);

		[VtblIndex(7)]
		HResult SetColorContexts(uint cCount, IWICColorContext** ppIColorContext);

		[VtblIndex(8)]
		HResult SetPalette(IWICPalette* pIPalette);

		[VtblIndex(9)]
		HResult SetThumbnail(IWICBitmapSource* pIThumbnail);

		[VtblIndex(10)]
		HResult WritePixels(uint lineCount, uint cbStride, uint cbBufferSize, byte* pbPixels);

		[VtblIndex(11)]
		HResult WriteSource(IWICBitmapSource* pIBitmapSource, System.Drawing.Rectangle* prc);

		[VtblIndex(12)]
		HResult Commit();

		[VtblIndex(13)]
		HResult GetMetadataQueryWriter(IWICMetadataQueryWriter** ppIMetadataQueryWriter);
	}
}

