#include "Qt_Image_Adapter.h"

namespace renderive {

QImage Qt_Image_Adapter::to_qimage(const Image_View& view) {
    if (view.empty())
        return {};

    return QImage(
        reinterpret_cast<const uchar*>(view.data),
        view.width,
        view.height,
        view.stride,
        QImage::Format_ARGB32_Premultiplied
    );
}

} // namespace renderive
