From e63752e6bb886d83af0c22faa673ea4cf99729f0 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 17 Mar 2015 14:07:37 +0100 Subject: Remove table of mostly null pointers The patch moves the initialization of the format to format blend tables to runtime, so we only have to explicitly set the values that are not null. This removes most of the lines in qblendfunctions.cpp. Change-Id: Ie017f380ff11cfb764a631cfea7626786731b5fb Reviewed-by: Gunnar Sletta --- src/gui/kernel/qguiapplication.cpp | 3 + src/gui/painting/qblendfunctions.cpp | 2136 ++-------------------------------- 2 files changed, 73 insertions(+), 2066 deletions(-) (limited to 'src/gui') diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 9f73f019a3..47c20a71fc 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -185,6 +185,7 @@ extern void qRegisterGuiVariant(); #ifndef QT_NO_ANIMATION extern void qRegisterGuiGetInterpolator(); #endif +extern void qInitBlendFunctions(); extern void qInitDrawhelperAsm(); extern void qInitImageConversions(); @@ -1279,6 +1280,8 @@ void QGuiApplicationPrivate::init() if (platform_integration == 0) createPlatformIntegration(); + // Set up blend function tables. + qInitBlendFunctions(); // Set up which span functions should be used in raster engine... qInitDrawhelperAsm(); // and QImage conversion functions diff --git a/src/gui/painting/qblendfunctions.cpp b/src/gui/painting/qblendfunctions.cpp index 478fe6564c..b3710411c9 100644 --- a/src/gui/painting/qblendfunctions.cpp +++ b/src/gui/painting/qblendfunctions.cpp @@ -432,10 +432,10 @@ static void qt_blend_argb32pm_on_a2rgb30pm(uchar *destPixels, int dbpl, } template -void qt_blend_rgb32_on_rgb30(uchar *destPixels, int dbpl, - const uchar *srcPixels, int sbpl, - int w, int h, - int const_alpha) +static void qt_blend_rgb32_on_rgb30(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) { #ifdef QT_DEBUG_DRAW fprintf(stdout, "qt_blend_rgb32_on_rgb30: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", @@ -496,10 +496,10 @@ static void qt_blend_a2rgb30pm_on_a2rgb30pm(uchar *destPixels, int dbpl, } -void qt_blend_rgb30_on_rgb30(uchar *destPixels, int dbpl, - const uchar *srcPixels, int sbpl, - int w, int h, - int const_alpha) +static void qt_blend_rgb30_on_rgb30(uchar *destPixels, int dbpl, + const uchar *srcPixels, int sbpl, + int w, int h, + int const_alpha) { #ifdef QT_DEBUG_DRAW fprintf(stdout, "qt_blend_rgb30_on_rgb30: dst=(%p, %d), src=(%p, %d), dim=(%d, %d) alpha=%d\n", @@ -740,2071 +740,75 @@ void qt_transform_image_argb32_on_argb32(uchar *destPixels, int dbpl, } } -SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats] = { - { // Format_Invalid - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGRs30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Mono - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_MonoLSB - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Indexed8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB32 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_scale_image_rgb32_on_rgb32, // Format_RGB32, - 0, // Format_ARGB32, - qt_scale_image_argb32_on_argb32, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB32 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB32_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_scale_image_rgb32_on_rgb32, // Format_RGB32, - 0, // Format_ARGB32, - qt_scale_image_argb32_on_argb32, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB16 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - qt_scale_image_argb32_on_rgb16, // Format_ARGB32_Premultiplied, - qt_scale_image_rgb16_on_rgb16, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB8565_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB666 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB6666_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB555 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB8555_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB444 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB4444_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBX8888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - qt_scale_image_rgb32_on_rgb32, // Format_RGBX8888, - 0, // Format_RGBA8888, - qt_scale_image_argb32_on_argb32, // Format_RGBA8888_Premultiplied, -#else - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, -#endif - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBA8888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBA8888_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - qt_scale_image_rgb32_on_rgb32, // Format_RGBX8888, - 0, // Format_RGBA8888, - qt_scale_image_argb32_on_argb32, // Format_RGBA8888_Premultiplied, -#else - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, -#endif - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_BGR30 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_A2BGR30_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB30 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_A2RGB30_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Alpha8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Grayscale8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - } -}; - +SrcOverScaleFunc qScaleFunctions[QImage::NImageFormats][QImage::NImageFormats]; +SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats]; +SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats]; -SrcOverBlendFunc qBlendFunctions[QImage::NImageFormats][QImage::NImageFormats] = { - { // Format_Invalid - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Mono - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_MonoLSB - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Indexed8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB32 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_blend_rgb32_on_rgb32, // Format_RGB32, - 0, // Format_ARGB32, - qt_blend_argb32_on_argb32, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB32 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB32_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_blend_rgb32_on_rgb32, // Format_RGB32, - 0, // Format_ARGB32, - qt_blend_argb32_on_argb32, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB16 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_blend_rgb32_on_rgb16, // Format_RGB32, - 0, // Format_ARGB32, - qt_blend_argb32_on_rgb16, // Format_ARGB32_Premultiplied, - qt_blend_rgb16_on_rgb16, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB8565_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB666 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB6666_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB555 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB8555_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB444 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB4444_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBX8888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, -#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - qt_blend_rgb32_on_rgb32, // Format_RGBX8888, - 0, // Format_RGBA8888, - qt_blend_argb32_on_argb32, // Format_RGBA8888_Premultiplied, -#else - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, -#endif - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBA8888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBA8888_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, +void qInitBlendFunctions() +{ + qScaleFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_scale_image_rgb32_on_rgb32; + qScaleFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32; + qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_scale_image_rgb32_on_rgb32; + qScaleFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_argb32; + qScaleFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_scale_image_argb32_on_rgb16; + qScaleFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_scale_image_rgb16_on_rgb16; #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - qt_blend_rgb32_on_rgb32, // Format_RGBX8888, - 0, // Format_RGBA8888, - qt_blend_argb32_on_argb32, // Format_RGBA8888_Premultiplied, -#else - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, + qScaleFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_scale_image_rgb32_on_rgb32; + qScaleFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_scale_image_argb32_on_argb32; + qScaleFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_scale_image_rgb32_on_rgb32; + qScaleFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_scale_image_argb32_on_argb32; #endif - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_BGR30 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_blend_rgb32_on_rgb30, // Format_RGB32, - 0, // Format_ARGB32, - qt_blend_argb32pm_on_a2rgb30pm, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - qt_blend_rgb30_on_rgb30, // Format_RGB30, - qt_blend_a2rgb30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, - qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_RGB30, - qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, - 0, 0, - }, - { // Format_A2BGR30_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_blend_rgb32_on_rgb30, // Format_RGB32, - 0, // Format_ARGB32, - qt_blend_argb32pm_on_a2rgb30pm, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - qt_blend_rgb30_on_rgb30, // Format_BGR30, - qt_blend_a2rgb30pm_on_a2rgb30pm, // Format_A2BGR30_Premultiplied, - qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_RGB30, - qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, - 0, 0, - }, - { // Format_RGB30 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_blend_rgb32_on_rgb30, // Format_RGB32, - 0, // Format_ARGB32, - qt_blend_argb32pm_on_a2rgb30pm, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_BGR30, - qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_A2BGR30_Premultiplied, - qt_blend_rgb30_on_rgb30, // Format_RGB30, - qt_blend_a2rgb30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, - 0, 0, - }, - { // Format_A2RGB30_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_blend_rgb32_on_rgb30, // Format_RGB32, - 0, // Format_ARGB32, - qt_blend_argb32pm_on_a2rgb30pm, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_BGR30, - qt_blend_a2bgr30pm_on_a2rgb30pm, // Format_A2BGR30_Premultiplied, - qt_blend_rgb30_on_rgb30, // Format_RGB30, - qt_blend_a2rgb30pm_on_a2rgb30pm, // Format_A2RGB30_Premultiplied, - 0, 0, - }, - { // Format_Alpha8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Grayscale8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - } -}; -SrcOverTransformFunc qTransformFunctions[QImage::NImageFormats][QImage::NImageFormats] = { - { // Format_Invalid - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Mono - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_MonoLSB - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Indexed8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB32 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_transform_image_rgb32_on_rgb32, // Format_RGB32, - 0, // Format_ARGB32, - qt_transform_image_argb32_on_argb32, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB32 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB32_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - qt_transform_image_rgb32_on_rgb32, // Format_RGB32, - 0, // Format_ARGB32, - qt_transform_image_argb32_on_argb32, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB16 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - qt_transform_image_argb32_on_rgb16, // Format_ARGB32_Premultiplied, - qt_transform_image_rgb16_on_rgb16, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB8565_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB666 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB6666_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB555 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB8555_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB444 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_ARGB4444_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBX8888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, + qBlendFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32; + qBlendFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb32; + qBlendFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_argb32; + qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb16; + qBlendFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32_on_rgb16; + qBlendFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_blend_rgb16_on_rgb16; #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - qt_transform_image_rgb32_on_rgb32, // Format_RGBX8888, - 0, // Format_RGBA8888, - qt_transform_image_argb32_on_argb32, // Format_RGBA8888_Premultiplied, -#else - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, + qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32; + qBlendFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32; + qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_blend_rgb32_on_rgb32; + qBlendFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_blend_argb32_on_argb32; #endif - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBA8888 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGBA8888_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, + qBlendFunctions[QImage::Format_BGR30][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb30; + qBlendFunctions[QImage::Format_BGR30][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_BGR30][QImage::Format_BGR30] = qt_blend_rgb30_on_rgb30; + qBlendFunctions[QImage::Format_BGR30][QImage::Format_A2BGR30_Premultiplied] = qt_blend_a2rgb30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_BGR30][QImage::Format_RGB30] = qt_blend_a2bgr30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_BGR30][QImage::Format_A2RGB30_Premultiplied] = qt_blend_a2bgr30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb30; + qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_BGR30] = qt_blend_rgb30_on_rgb30; + qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_A2BGR30_Premultiplied] = qt_blend_a2rgb30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_RGB30] = qt_blend_a2bgr30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_A2BGR30_Premultiplied][QImage::Format_A2RGB30_Premultiplied] = qt_blend_a2bgr30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_RGB30][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb30; + qBlendFunctions[QImage::Format_RGB30][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_RGB30][QImage::Format_BGR30] = qt_blend_a2bgr30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_RGB30][QImage::Format_A2BGR30_Premultiplied] = qt_blend_a2bgr30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_RGB30][QImage::Format_RGB30] = qt_blend_rgb30_on_rgb30; + qBlendFunctions[QImage::Format_RGB30][QImage::Format_A2RGB30_Premultiplied] = qt_blend_a2rgb30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_RGB32] = qt_blend_rgb32_on_rgb30; + qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_blend_argb32pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_BGR30] = qt_blend_a2bgr30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_A2BGR30_Premultiplied] = qt_blend_a2bgr30pm_on_a2rgb30pm; + qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_RGB30] = qt_blend_rgb30_on_rgb30; + qBlendFunctions[QImage::Format_A2RGB30_Premultiplied][QImage::Format_A2RGB30_Premultiplied] = qt_blend_a2rgb30pm_on_a2rgb30pm; + + qTransformFunctions[QImage::Format_RGB32][QImage::Format_RGB32] = qt_transform_image_rgb32_on_rgb32; + qTransformFunctions[QImage::Format_RGB32][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_argb32; + qTransformFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_RGB32] = qt_transform_image_rgb32_on_rgb32; + qTransformFunctions[QImage::Format_ARGB32_Premultiplied][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_argb32; + qTransformFunctions[QImage::Format_RGB16][QImage::Format_ARGB32_Premultiplied] = qt_transform_image_argb32_on_rgb16; + qTransformFunctions[QImage::Format_RGB16][QImage::Format_RGB16] = qt_transform_image_rgb16_on_rgb16; #if Q_BYTE_ORDER == Q_LITTLE_ENDIAN - qt_transform_image_rgb32_on_rgb32, // Format_RGBX8888, - 0, // Format_RGBA8888, - qt_transform_image_argb32_on_argb32, // Format_RGBA8888_Premultiplied, -#else - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, + qTransformFunctions[QImage::Format_RGBX8888][QImage::Format_RGBX8888] = qt_transform_image_rgb32_on_rgb32; + qTransformFunctions[QImage::Format_RGBX8888][QImage::Format_RGBA8888_Premultiplied] = qt_transform_image_argb32_on_argb32; + qTransformFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBX8888] = qt_transform_image_rgb32_on_rgb32; + qTransformFunctions[QImage::Format_RGBA8888_Premultiplied][QImage::Format_RGBA8888_Premultiplied] = qt_transform_image_argb32_on_argb32; #endif - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_BGR30 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_A2BGR30_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_RGB30 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_A2RGB30_Premultiplied - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Alpha8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, - { // Format_Grayscale8 - 0, // Format_Invalid, - 0, // Format_Mono, - 0, // Format_MonoLSB, - 0, // Format_Indexed8, - 0, // Format_RGB32, - 0, // Format_ARGB32, - 0, // Format_ARGB32_Premultiplied, - 0, // Format_RGB16, - 0, // Format_ARGB8565_Premultiplied, - 0, // Format_RGB666, - 0, // Format_ARGB6666_Premultiplied, - 0, // Format_RGB555, - 0, // Format_ARGB8555_Premultiplied, - 0, // Format_RGB888, - 0, // Format_RGB444, - 0, // Format_ARGB4444_Premultiplied, - 0, // Format_RGBX8888, - 0, // Format_RGBA8888, - 0, // Format_RGBA8888_Premultiplied, - 0, // Format_BGR30, - 0, // Format_A2BGR30_Premultiplied, - 0, // Format_RGB30, - 0, // Format_A2RGB30_Premultiplied, - 0, // Format_Alpha8 - 0, // Format_Grayscale8 - }, -}; +} QT_END_NAMESPACE -- cgit v1.2.3