private static HeifBooleanEncoderParameter CreateBooleanParameter(SafeHeifEncoder encoder,
                                                                          string name,
                                                                          bool hasDefaultValue)
        {
            bool defaultValue = false;

            if (hasDefaultValue)
            {
                // The error value is ignored because some encoders return an error
                // when getting the value of a valid command.
                _ = LibHeifNative.heif_encoder_get_parameter_boolean(encoder, name, out defaultValue);
            }

            return(new HeifBooleanEncoderParameter(name, hasDefaultValue, defaultValue));
        }