#pragma once

#include "foundation/result.h"
#include "paint/blend.h"
#include "renderer_api/renderer_api.h"

#include <span>

namespace pp::paint_renderer {

struct LayerCompositeView {
    std::span<const pp::paint::Rgba> pixels;
    float opacity = 1.0F;
    bool visible = true;
    pp::paint::BlendMode blend_mode = pp::paint::BlendMode::normal;
};

[[nodiscard]] pp::foundation::Status composite_layer(
    std::span<pp::paint::Rgba> destination,
    pp::renderer::Extent2D extent,
    LayerCompositeView layer) noexcept;

}
