C
Qt Quick Ultralite traveo_t2g_effects 示例
/****************************************************************************** ** ** Copyright (C) 2021 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Quick Ultralite module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see http://www.qt.io/terms-conditions. For further ** information use the contact form at http://www.qt.io/contact-us. ** ** $QT_END_LICENSE$ ** ******************************************************************************/#ifndef QUL_TVIIC_PLATFORM #include <QImage> #include <QTransform> #include <qul/pixelformat.h> #include <platforminterface/transform.h> #include <cassert> static inline ::QTransform toQTransform(const Qul::PlatformInterface::Transform &t) { return ::QTransform(t.m11(), t.m12(), t.m13(), t.m21(), t.m22(), t.m23(), t.m31(), t.m32(), t.m33()); } static inline QImage::Format toQImageFormat(Qul::PixelFormat format) { switch (format) { case Qul::PixelFormat_ARGB32: return QImage::Format_ARGB32; case Qul::PixelFormat_ARGB32_Premultiplied: return QImage::Format_ARGB32_Premultiplied; case Qul::PixelFormat_RGB32: return QImage::Format_RGB32; case Qul::PixelFormat_RGB888: return QImage::Format_RGB888; case Qul::PixelFormat_RGB16: return QImage::Format_RGB16; case Qul::PixelFormat_Alpha8: return QImage::Format_Alpha8; case Qul::PixelFormat_ARGB4444_Premultiplied: return QImage::Format_ARGB4444_Premultiplied; case Qul::PixelFormat_ARGB4444: case Qul::PixelFormat_RGB332: default: assert(false); return QImage::Format_Invalid; } }; #endif