/// <summary>Decrease the reference count toward the loaded native library.</summary> /// <remarks> /// When reference count reaches 0, the native library will be unloaded. /// Calling this method does not guarantee the native library to be unloaded immediately. /// This method will not dispose any objects (Eg: <seealso cref="WebpImageDecoder"/>) created from this <see cref="WebpFactory"/> instance, either. /// </remarks> public void Dispose() { if (this.disposed) { return; } this.disposed = true; Libwebp.Deinit(this.library); this.library = null; }
/// <summary> /// Initialize a new instance of <see cref="WebpFactory"/>. /// </summary> /// <param name="libraryPath">The path to the native library.</param> public WebpFactory(string libraryPath) { this.disposed = false; this.library = Libwebp.Init(libraryPath); }