using DragonISO.Engine.Domain;

namespace DragonISO.Engine.Pipeline;

/// <summary>
/// Phase A scaler. Copies the source frame's pixel buffer through unchanged and tags the
/// output with the requested target dimensions. Real scaling is added in Phase B against libyuv.
/// </summary>
public sealed class PassthroughFrameScaler : IFrameScaler
{
    public ProcessedFrame Scale(RawFrame source, int targetWidth, int targetHeight, AspectMode aspect, long timestampTicks)
    {
        return new ProcessedFrame(
            Width: targetWidth,
            Height: targetHeight,
            TimestampTicks: timestampTicks,
            Pixels: source.Pixels,
            Format: source.Format == PixelFormat.Bgra ? PixelFormat.Bgra : PixelFormat.Bgra);
    }
}
