// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System;
using System.Diagnostics.CodeAnalysis;
namespace SixLabors.ImageSharp.Formats {
///
/// Used for detecting mime types from a file header
///
public interface IImageFormatDetector
{
///
/// Gets the size of the header for this image type.
///
/// The size of the header.
int HeaderSize { get; }
///
/// Detect mimetype
///
/// The containing the file header.
/// The mime type of detected otherwise returns null
/// returns true when format was detected otherwise false.
bool TryDetectFormat(ReadOnlySpan header, [NotNullWhen(true)] out IImageFormat? format);
}
}