/// <summary>
        /// Creates the encoding options.
        /// </summary>
        /// <returns>The encoding options.</returns>
        /// <exception cref="HeifException">Unable to create the native HeifEncodingOptions.</exception>
        internal unsafe SafeHeifEncodingOptions CreateEncodingOptions()
        {
            var encodingOptions = LibHeifNative.heif_encoding_options_alloc();

            if (encodingOptions.IsInvalid)
            {
                ExceptionUtil.ThrowHeifException(Properties.Resources.HeifEncodingOptionsCreationFailed);
            }

            var options = (EncodingOptionsVersion1 *)encodingOptions.DangerousGetHandle();

            options->save_alpha_channel = (byte)(this.SaveAlphaChannel ? 1 : 0);

            return(encodingOptions);
        }