Rename QRgbaF to QRgbaFloat and assert the compatible types
Pick-to: 6.2 Change-Id: I2404fdfd43d3b4553760ad2f605175121cd31446 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>bb10
parent
565864090d
commit
b0e428124b
|
|
@ -195,7 +195,7 @@ qt_internal_add_module(Gui
|
|||
painting/qregion.cpp painting/qregion.h
|
||||
painting/qrgb.h
|
||||
painting/qrgba64.h painting/qrgba64_p.h
|
||||
painting/qrgbaf.h
|
||||
painting/qrgbafloat.h
|
||||
painting/qstroker.cpp painting/qstroker_p.h
|
||||
painting/qtextureglyphcache.cpp painting/qtextureglyphcache_p.h
|
||||
painting/qtransform.cpp painting/qtransform.h
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
#include "qtransform.h"
|
||||
#include "qimagereader.h"
|
||||
#include "qimagewriter.h"
|
||||
#include "qrgbaf.h"
|
||||
#include "qrgbafloat.h"
|
||||
#include "qstringlist.h"
|
||||
#include "qvariant.h"
|
||||
#include "qimagepixmapcleanuphooks_p.h"
|
||||
|
|
@ -1779,16 +1779,16 @@ void QImage::fill(uint pixel)
|
|||
return;
|
||||
} else if (d->format >= QImage::Format_RGBX16FPx4 && d->format <= QImage::Format_RGBA16FPx4_Premultiplied) {
|
||||
quint64 cu;
|
||||
QRgba16F cf = QRgba16F::fromArgb32(pixel);
|
||||
QRgbaFloat16 cf = QRgbaFloat16::fromArgb32(pixel);
|
||||
::memcpy(&cu, &cf, sizeof(quint64));
|
||||
qt_rectfill<quint64>(reinterpret_cast<quint64*>(d->data), cu,
|
||||
0, 0, d->width, d->height, d->bytes_per_line);
|
||||
return;
|
||||
} else if (d->format >= QImage::Format_RGBX32FPx4 && d->format <= QImage::Format_RGBA32FPx4_Premultiplied) {
|
||||
QRgba32F cf = QRgba32F::fromArgb32(pixel);
|
||||
QRgbaFloat32 cf = QRgbaFloat32::fromArgb32(pixel);
|
||||
uchar *data = d->data;
|
||||
for (int y = 0; y < d->height; ++y) {
|
||||
QRgba32F *line = reinterpret_cast<QRgba32F *>(data);
|
||||
QRgbaFloat32 *line = reinterpret_cast<QRgbaFloat32 *>(data);
|
||||
for (int x = 0; x < d->width; ++x)
|
||||
line[x] = cf;
|
||||
data += d->bytes_per_line;
|
||||
|
|
@ -2506,11 +2506,11 @@ QRgb QImage::pixel(int x, int y) const
|
|||
case Format_RGBX16FPx4:
|
||||
case Format_RGBA16FPx4: // Match ARGB32 behavior.
|
||||
case Format_RGBA16FPx4_Premultiplied:
|
||||
return reinterpret_cast<const QRgba16F *>(s)[x].toArgb32();
|
||||
return reinterpret_cast<const QRgbaFloat16 *>(s)[x].toArgb32();
|
||||
case Format_RGBX32FPx4:
|
||||
case Format_RGBA32FPx4: // Match ARGB32 behavior.
|
||||
case Format_RGBA32FPx4_Premultiplied:
|
||||
return reinterpret_cast<const QRgba32F *>(s)[x].toArgb32();
|
||||
return reinterpret_cast<const QRgbaFloat32 *>(s)[x].toArgb32();
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -2613,18 +2613,18 @@ void QImage::setPixel(int x, int y, uint index_or_rgb)
|
|||
((QRgba64 *)s)[x] = QRgba64::fromArgb32(index_or_rgb);
|
||||
return;
|
||||
case Format_RGBX16FPx4:
|
||||
((QRgba16F *)s)[x] = QRgba16F::fromArgb32(index_or_rgb | 0xff000000);
|
||||
((QRgbaFloat16 *)s)[x] = QRgbaFloat16::fromArgb32(index_or_rgb | 0xff000000);
|
||||
return;
|
||||
case Format_RGBA16FPx4:
|
||||
case Format_RGBA16FPx4_Premultiplied:
|
||||
((QRgba16F *)s)[x] = QRgba16F::fromArgb32(index_or_rgb);
|
||||
((QRgbaFloat16 *)s)[x] = QRgbaFloat16::fromArgb32(index_or_rgb);
|
||||
return;
|
||||
case Format_RGBX32FPx4:
|
||||
((QRgba32F *)s)[x] = QRgba32F::fromArgb32(index_or_rgb | 0xff000000);
|
||||
((QRgbaFloat32 *)s)[x] = QRgbaFloat32::fromArgb32(index_or_rgb | 0xff000000);
|
||||
return;
|
||||
case Format_RGBA32FPx4:
|
||||
case Format_RGBA32FPx4_Premultiplied:
|
||||
((QRgba32F *)s)[x] = QRgba32F::fromArgb32(index_or_rgb);
|
||||
((QRgbaFloat32 *)s)[x] = QRgbaFloat32::fromArgb32(index_or_rgb);
|
||||
return;
|
||||
case Format_Invalid:
|
||||
case NImageFormats:
|
||||
|
|
@ -2693,7 +2693,7 @@ QColor QImage::pixelColor(int x, int y) const
|
|||
case Format_RGBX16FPx4:
|
||||
case Format_RGBA16FPx4:
|
||||
case Format_RGBA16FPx4_Premultiplied: {
|
||||
QRgba16F p = reinterpret_cast<const QRgba16F *>(s)[x];
|
||||
QRgbaFloat16 p = reinterpret_cast<const QRgbaFloat16 *>(s)[x];
|
||||
if (d->format == Format_RGBA16FPx4_Premultiplied)
|
||||
p = p.unpremultiplied();
|
||||
QColor color;
|
||||
|
|
@ -2703,7 +2703,7 @@ QColor QImage::pixelColor(int x, int y) const
|
|||
case Format_RGBX32FPx4:
|
||||
case Format_RGBA32FPx4:
|
||||
case Format_RGBA32FPx4_Premultiplied: {
|
||||
QRgba32F p = reinterpret_cast<const QRgba32F *>(s)[x];
|
||||
QRgbaFloat32 p = reinterpret_cast<const QRgbaFloat32 *>(s)[x];
|
||||
if (d->format == Format_RGBA32FPx4_Premultiplied)
|
||||
p = p.unpremultiplied();
|
||||
QColor color;
|
||||
|
|
@ -2792,10 +2792,10 @@ void QImage::setPixelColor(int x, int y, const QColor &color)
|
|||
color.getRgbF(&r, &g, &b, &a);
|
||||
if (d->format == Format_RGBX16FPx4)
|
||||
a = 1.0f;
|
||||
QRgba16F c16f{r, g, b, a};
|
||||
QRgbaFloat16 c16f{r, g, b, a};
|
||||
if (d->format == Format_RGBA16FPx4_Premultiplied)
|
||||
c16f = c16f.premultiplied();
|
||||
((QRgba16F *)s)[x] = c16f;
|
||||
((QRgbaFloat16 *)s)[x] = c16f;
|
||||
return;
|
||||
}
|
||||
case Format_RGBX32FPx4:
|
||||
|
|
@ -2805,10 +2805,10 @@ void QImage::setPixelColor(int x, int y, const QColor &color)
|
|||
color.getRgbF(&r, &g, &b, &a);
|
||||
if (d->format == Format_RGBX32FPx4)
|
||||
a = 1.0f;
|
||||
QRgba32F c32f{r, g, b, a};
|
||||
QRgbaFloat32 c32f{r, g, b, a};
|
||||
if (d->format == Format_RGBA32FPx4_Premultiplied)
|
||||
c32f = c32f.premultiplied();
|
||||
((QRgba32F *)s)[x] = c32f;
|
||||
((QRgbaFloat32 *)s)[x] = c32f;
|
||||
return;
|
||||
}
|
||||
default:
|
||||
|
|
@ -3372,7 +3372,7 @@ inline void do_mirror(QImageData *dst, QImageData *src, bool horizontal, bool ve
|
|||
|
||||
switch (depth) {
|
||||
case 128:
|
||||
do_mirror_data<QRgba32F>(dst, src, dstX0, dstY0, dstXIncr, dstYIncr, w, h);
|
||||
do_mirror_data<QRgbaFloat32>(dst, src, dstX0, dstY0, dstXIncr, dstYIncr, w, h);
|
||||
break;
|
||||
case 64:
|
||||
do_mirror_data<quint64>(dst, src, dstX0, dstY0, dstXIncr, dstYIncr, w, h);
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@
|
|||
#include <private/qimage_p.h>
|
||||
|
||||
#include <qendian.h>
|
||||
#include <qrgbaf.h>
|
||||
#include <qrgbafloat.h>
|
||||
#if QT_CONFIG(thread)
|
||||
#include <qsemaphore.h>
|
||||
#include <qthreadpool.h>
|
||||
|
|
@ -324,8 +324,8 @@ void convert_generic_over_rgba32f(QImageData *dest, const QImageData *src, Qt::I
|
|||
const ConvertAndStorePixelsFuncFP store = qStoreFromRGBA32F[dest->format];
|
||||
|
||||
auto convertSegment = [=](int yStart, int yEnd) {
|
||||
QRgba32F buf[BufferSize];
|
||||
QRgba32F *buffer = buf;
|
||||
QRgbaFloat32 buf[BufferSize];
|
||||
QRgbaFloat32 *buffer = buf;
|
||||
const uchar *srcData = src->data + yStart * src->bytes_per_line;
|
||||
uchar *destData = dest->data + yStart * dest->bytes_per_line;
|
||||
for (int y = yStart; y < yEnd; ++y) {
|
||||
|
|
@ -333,10 +333,10 @@ void convert_generic_over_rgba32f(QImageData *dest, const QImageData *src, Qt::I
|
|||
while (x < src->width) {
|
||||
int l = src->width - x;
|
||||
if (dest->depth == 128)
|
||||
buffer = reinterpret_cast<QRgba32F *>(destData) + x;
|
||||
buffer = reinterpret_cast<QRgbaFloat32 *>(destData) + x;
|
||||
else
|
||||
l = qMin(l, BufferSize);
|
||||
const QRgba32F *ptr = fetch(buffer, srcData, x, l, nullptr, nullptr);
|
||||
const QRgbaFloat32 *ptr = fetch(buffer, srcData, x, l, nullptr, nullptr);
|
||||
store(destData, ptr, x, l, nullptr, nullptr);
|
||||
x += l;
|
||||
}
|
||||
|
|
@ -621,8 +621,8 @@ bool convert_generic_inplace_over_rgba32f(QImageData *data, QImage::Format dst_f
|
|||
}
|
||||
|
||||
auto convertSegment = [=](int yStart, int yEnd) {
|
||||
QRgba32F buf[BufferSize];
|
||||
QRgba32F *buffer = buf;
|
||||
QRgbaFloat32 buf[BufferSize];
|
||||
QRgbaFloat32 *buffer = buf;
|
||||
uchar *srcData = data->data + yStart * data->bytes_per_line;
|
||||
uchar *destData = srcData;
|
||||
for (int y = yStart; y < yEnd; ++y) {
|
||||
|
|
@ -630,10 +630,10 @@ bool convert_generic_inplace_over_rgba32f(QImageData *data, QImage::Format dst_f
|
|||
while (x < data->width) {
|
||||
int l = data->width - x;
|
||||
if (srcLayout->bpp == QPixelLayout::BPP32FPx4)
|
||||
buffer = reinterpret_cast<QRgba32F *>(srcData) + x;
|
||||
buffer = reinterpret_cast<QRgbaFloat32 *>(srcData) + x;
|
||||
else
|
||||
l = qMin(l, BufferSize);
|
||||
const QRgba32F *ptr = fetch(buffer, srcData, x, l, nullptr, nullptr);
|
||||
const QRgbaFloat32 *ptr = fetch(buffer, srcData, x, l, nullptr, nullptr);
|
||||
store(destData, ptr, x, l, nullptr, nullptr);
|
||||
x += l;
|
||||
}
|
||||
|
|
@ -1586,11 +1586,11 @@ static void convert_RGBA16FPM_to_RGBA16F(QImageData *dest, const QImageData *src
|
|||
|
||||
const int src_pad = (src->bytes_per_line >> 3) - src->width;
|
||||
const int dest_pad = (dest->bytes_per_line >> 3) - dest->width;
|
||||
const QRgba16F *src_data = reinterpret_cast<const QRgba16F *>(src->data);
|
||||
QRgba16F *dest_data = reinterpret_cast<QRgba16F *>(dest->data);
|
||||
const QRgbaFloat16 *src_data = reinterpret_cast<const QRgbaFloat16 *>(src->data);
|
||||
QRgbaFloat16 *dest_data = reinterpret_cast<QRgbaFloat16 *>(dest->data);
|
||||
|
||||
for (int i = 0; i < src->height; ++i) {
|
||||
const QRgba16F *end = src_data + src->width;
|
||||
const QRgbaFloat16 *end = src_data + src->width;
|
||||
while (src_data < end) {
|
||||
*dest_data = src_data->unpremultiplied();
|
||||
if (MaskAlpha)
|
||||
|
|
@ -1609,10 +1609,10 @@ static bool convert_RGBA16FPM_to_RGBA16F_inplace(QImageData *data, Qt::ImageConv
|
|||
Q_ASSERT(data->format == QImage::Format_RGBA16FPx4_Premultiplied);
|
||||
|
||||
const int pad = (data->bytes_per_line >> 3) - data->width;
|
||||
QRgba16F *rgb_data = reinterpret_cast<QRgba16F *>(data->data);
|
||||
QRgbaFloat16 *rgb_data = reinterpret_cast<QRgbaFloat16 *>(data->data);
|
||||
|
||||
for (int i = 0; i < data->height; ++i) {
|
||||
const QRgba16F *end = rgb_data + data->width;
|
||||
const QRgbaFloat16 *end = rgb_data + data->width;
|
||||
while (rgb_data < end) {
|
||||
*rgb_data = rgb_data->unpremultiplied();
|
||||
if (MaskAlpha)
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
#include "qdrawhelper_p.h"
|
||||
#include "qrgba64_p.h"
|
||||
#include "qrgbaf.h"
|
||||
#include "qrgbafloat.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -328,14 +328,14 @@ typedef Rgba64OperationsC Rgba64Operations;
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
|
||||
static inline QRgba32F qRgba32f(float r, float g, float b, float a)
|
||||
static inline QRgbaFloat32 qRgbaFloat32(float r, float g, float b, float a)
|
||||
{
|
||||
return QRgba32F{r, g, b, a};
|
||||
return QRgbaFloat32{r, g, b, a};
|
||||
}
|
||||
|
||||
struct RgbaFPOperationsBase
|
||||
{
|
||||
typedef QRgba32F Type;
|
||||
typedef QRgbaFloat32 Type;
|
||||
typedef float Scalar;
|
||||
|
||||
static inline constexpr Type clear = { 0, 0, 0, 0 };
|
||||
|
|
@ -358,16 +358,16 @@ struct RgbaFPOperationsBase
|
|||
|
||||
struct RgbaFPOperationsC : RgbaFPOperationsBase
|
||||
{
|
||||
typedef QRgba32F OptimalType;
|
||||
typedef QRgbaFloat32 OptimalType;
|
||||
typedef float OptimalScalar;
|
||||
|
||||
static OptimalType load(const Type *ptr)
|
||||
{
|
||||
return QRgba32F { ptr->r, ptr->g, ptr->b, ptr->a };
|
||||
return QRgbaFloat32 { ptr->r, ptr->g, ptr->b, ptr->a };
|
||||
}
|
||||
static OptimalType convert(const Type &val)
|
||||
{
|
||||
return QRgba32F { val.r, val.g, val.b, val.a };
|
||||
return QRgbaFloat32 { val.r, val.g, val.b, val.a };
|
||||
}
|
||||
static void store(Type *ptr, OptimalType value)
|
||||
{
|
||||
|
|
@ -546,12 +546,12 @@ void QT_FASTCALL comp_func_Clear_rgb64(QRgba64 *dest, const QRgba64 *, int lengt
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_Clear_rgbafp(QRgba32F *dest, int length, QRgba32F, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Clear_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32, uint const_alpha)
|
||||
{
|
||||
comp_func_Clear_template<RgbaFPOperations>(dest, length, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Clear_rgbafp(QRgba32F *dest, const QRgba32F *, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Clear_rgbafp(QRgbaFloat32 *dest, const QRgbaFloat32 *, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_Clear_template<RgbaFPOperations>(dest, length, const_alpha);
|
||||
}
|
||||
|
|
@ -616,12 +616,12 @@ void QT_FASTCALL comp_func_Source_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRg
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_Source_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Source_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_Source_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Source_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Source_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_Source_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -646,11 +646,11 @@ void QT_FASTCALL comp_func_Destination_rgb64(QRgba64 *, const QRgba64 *, int, ui
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_Destination_rgbafp(QRgba32F *, int, QRgba32F, uint)
|
||||
void QT_FASTCALL comp_func_solid_Destination_rgbafp(QRgbaFloat32 *, int, QRgbaFloat32, uint)
|
||||
{
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Destination_rgbafp(QRgba32F *, const QRgba32F *, int, uint)
|
||||
void QT_FASTCALL comp_func_Destination_rgbafp(QRgbaFloat32 *, const QRgbaFloat32 *, int, uint)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
|
@ -726,13 +726,13 @@ void QT_FASTCALL comp_func_SourceOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_SourceOver_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_SourceOver_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_SourceOver_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
|
||||
void QT_FASTCALL comp_func_SourceOver_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_SourceOver_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_SourceOver_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -800,12 +800,12 @@ void QT_FASTCALL comp_func_DestinationOver_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_DestinationOver_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_DestinationOver_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_DestinationOver_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_DestinationOver_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_DestinationOver_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_DestinationOver_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -878,12 +878,12 @@ void QT_FASTCALL comp_func_SourceIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const Q
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_SourceIn_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_SourceIn_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_SourceIn_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_SourceIn_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_SourceIn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_SourceIn_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -951,12 +951,12 @@ void QT_FASTCALL comp_func_DestinationIn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, co
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_DestinationIn_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_DestinationIn_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_DestinationIn_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_DestinationIn_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_DestinationIn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_DestinationIn_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -1027,12 +1027,12 @@ void QT_FASTCALL comp_func_SourceOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_SourceOut_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_SourceOut_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_SourceOut_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_SourceOut_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_SourceOut_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_SourceOut_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -1100,12 +1100,12 @@ void QT_FASTCALL comp_func_DestinationOut_rgb64(QRgba64 *Q_DECL_RESTRICT dest, c
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_DestinationOut_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_DestinationOut_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_DestinationOut_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_DestinationOut_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_DestinationOut_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_DestinationOut_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -1173,12 +1173,12 @@ void QT_FASTCALL comp_func_SourceAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_SourceAtop_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_SourceAtop_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_SourceAtop_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_SourceAtop_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_SourceAtop_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_SourceAtop_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -1251,12 +1251,12 @@ void QT_FASTCALL comp_func_DestinationAtop_rgb64(QRgba64 *Q_DECL_RESTRICT dest,
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_DestinationAtop_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_DestinationAtop_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_DestinationAtop_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_DestinationAtop_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_DestinationAtop_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_DestinationAtop_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -1325,12 +1325,12 @@ void QT_FASTCALL comp_func_XOR_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba6
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_XOR_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_XOR_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_XOR_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_XOR_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_XOR_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_XOR_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -1348,7 +1348,7 @@ struct QFullCoverage {
|
|||
}
|
||||
#endif
|
||||
#if QT_CONFIG(raster_fp)
|
||||
inline void store(QRgba32F *dest, const QRgba32F src) const
|
||||
inline void store(QRgbaFloat32 *dest, const QRgbaFloat32 src) const
|
||||
{
|
||||
*dest = src;
|
||||
}
|
||||
|
|
@ -1378,7 +1378,7 @@ struct QPartialCoverage {
|
|||
}
|
||||
#endif
|
||||
#if QT_CONFIG(raster_fp)
|
||||
inline void store(QRgba32F *dest, const QRgba32F src) const
|
||||
inline void store(QRgbaFloat32 *dest, const QRgbaFloat32 src) const
|
||||
{
|
||||
store_template<RgbaFPOperations>(dest, src);
|
||||
}
|
||||
|
|
@ -1478,12 +1478,12 @@ void QT_FASTCALL comp_func_Plus_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRgba
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_Plus_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Plus_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
comp_func_solid_Plus_template<RgbaFPOperations>(dest, length, color, const_alpha);
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Plus_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Plus_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
comp_func_Plus_template<RgbaFPOperations>(dest, src, length, const_alpha);
|
||||
}
|
||||
|
|
@ -1573,7 +1573,7 @@ static inline float multiply_op_rgbafp(float dst, float src, float da, float sa)
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_Multiply_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_Multiply_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -1581,7 +1581,7 @@ static inline void comp_func_solid_Multiply_impl(QRgba32F *dest, int length, QRg
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) multiply_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -1591,11 +1591,11 @@ static inline void comp_func_solid_Multiply_impl(QRgba32F *dest, int length, QRg
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_Multiply_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Multiply_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_Multiply_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -1667,11 +1667,11 @@ void QT_FASTCALL comp_func_Multiply_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const Q
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_Multiply_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_Multiply_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -1683,11 +1683,11 @@ static inline void comp_func_Multiply_impl(QRgba32F *Q_DECL_RESTRICT dest, const
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Multiply_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Multiply_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_Multiply_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -1766,7 +1766,7 @@ void QT_FASTCALL comp_func_solid_Screen_rgb64(QRgba64 *dest, int length, QRgba64
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_Screen_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_Screen_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -1774,7 +1774,7 @@ static inline void comp_func_solid_Screen_impl(QRgba32F *dest, int length, QRgba
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) (1.0f - ((1.0f - a) * (1.0f - b)))
|
||||
|
|
@ -1784,11 +1784,11 @@ static inline void comp_func_solid_Screen_impl(QRgba32F *dest, int length, QRgba
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_Screen_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Screen_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_Screen_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -1859,11 +1859,11 @@ void QT_FASTCALL comp_func_Screen_rgb64(QRgba64 *dest, const QRgba64 *src, int l
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_Screen_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_Screen_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -1875,11 +1875,11 @@ static inline void comp_func_Screen_impl(QRgba32F *Q_DECL_RESTRICT dest, const Q
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Screen_rgbafp(QRgba32F *dest, const QRgba32F *src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Screen_rgbafp(QRgbaFloat32 *dest, const QRgbaFloat32 *src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_Screen_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -1987,7 +1987,7 @@ static inline float overlay_op_rgbafp(float dst, float src, float da, float sa)
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_Overlay_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_Overlay_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -1995,7 +1995,7 @@ static inline void comp_func_solid_Overlay_impl(QRgba32F *dest, int length, QRgb
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) overlay_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -2005,11 +2005,11 @@ static inline void comp_func_solid_Overlay_impl(QRgba32F *dest, int length, QRgb
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_Overlay_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Overlay_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_Overlay_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -2080,11 +2080,11 @@ void QT_FASTCALL comp_func_Overlay_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QR
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_Overlay_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_Overlay_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -2096,11 +2096,11 @@ static inline void comp_func_Overlay_impl(QRgba32F *Q_DECL_RESTRICT dest, const
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Overlay_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Overlay_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_Overlay_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -2194,7 +2194,7 @@ static inline float darken_op_rgbafp(float dst, float src, float da, float sa)
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_Darken_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_Darken_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -2202,7 +2202,7 @@ static inline void comp_func_solid_Darken_impl(QRgba32F *dest, int length, QRgba
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) darken_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -2212,11 +2212,11 @@ static inline void comp_func_solid_Darken_impl(QRgba32F *dest, int length, QRgba
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_Darken_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Darken_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_Darken_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -2287,11 +2287,11 @@ void QT_FASTCALL comp_func_Darken_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QRg
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_Darken_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_Darken_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -2303,11 +2303,11 @@ static inline void comp_func_Darken_impl(QRgba32F *Q_DECL_RESTRICT dest, const Q
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Darken_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Darken_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_Darken_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -2402,7 +2402,7 @@ static inline float lighten_op_rgbafp(float dst, float src, float da, float sa)
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_Lighten_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_Lighten_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -2410,7 +2410,7 @@ static inline void comp_func_solid_Lighten_impl(QRgba32F *dest, int length, QRgb
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) lighten_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -2420,11 +2420,11 @@ static inline void comp_func_solid_Lighten_impl(QRgba32F *dest, int length, QRgb
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_Lighten_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Lighten_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_Lighten_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -2495,11 +2495,11 @@ void QT_FASTCALL comp_func_Lighten_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const QR
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_Lighten_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_Lighten_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -2511,11 +2511,11 @@ static inline void comp_func_Lighten_impl(QRgba32F *Q_DECL_RESTRICT dest, const
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Lighten_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Lighten_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_Lighten_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -2643,7 +2643,7 @@ static inline float color_dodge_op_rgbafp(float dst, float src, float da, float
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_ColorDodge_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_ColorDodge_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -2651,7 +2651,7 @@ static inline void comp_func_solid_ColorDodge_impl(QRgba32F *dest, int length, Q
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a,b) color_dodge_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -2661,11 +2661,11 @@ static inline void comp_func_solid_ColorDodge_impl(QRgba32F *dest, int length, Q
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_ColorDodge_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_ColorDodge_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_ColorDodge_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -2736,11 +2736,11 @@ void QT_FASTCALL comp_func_ColorDodge_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_ColorDodge_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_ColorDodge_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -2752,11 +2752,11 @@ static inline void comp_func_ColorDodge_impl(QRgba32F *Q_DECL_RESTRICT dest, con
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_ColorDodge_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_ColorDodge_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_ColorDodge_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -2884,7 +2884,7 @@ static inline float color_burn_op_rgbafp(float dst, float src, float da, float s
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_ColorBurn_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_ColorBurn_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -2892,7 +2892,7 @@ static inline void comp_func_solid_ColorBurn_impl(QRgba32F *dest, int length, QR
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) color_burn_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -2902,11 +2902,11 @@ static inline void comp_func_solid_ColorBurn_impl(QRgba32F *dest, int length, QR
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_ColorBurn_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_ColorBurn_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_ColorBurn_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -2977,11 +2977,11 @@ void QT_FASTCALL comp_func_ColorBurn_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_ColorBurn_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_ColorBurn_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -2993,11 +2993,11 @@ static inline void comp_func_ColorBurn_impl(QRgba32F *Q_DECL_RESTRICT dest, cons
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_ColorBurn_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_ColorBurn_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_ColorBurn_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -3108,7 +3108,7 @@ static inline float hardlight_op_rgbafp(float dst, float src, float da, float sa
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_HardLight_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_HardLight_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -3116,7 +3116,7 @@ static inline void comp_func_solid_HardLight_impl(QRgba32F *dest, int length, QR
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) hardlight_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -3126,11 +3126,11 @@ static inline void comp_func_solid_HardLight_impl(QRgba32F *dest, int length, QR
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_HardLight_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_HardLight_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_HardLight_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -3201,11 +3201,11 @@ void QT_FASTCALL comp_func_HardLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_HardLight_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_HardLight_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -3217,11 +3217,11 @@ static inline void comp_func_HardLight_impl(QRgba32F *Q_DECL_RESTRICT dest, cons
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_HardLight_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_HardLight_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_HardLight_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -3351,7 +3351,7 @@ static inline float soft_light_op_rgbafp(float dst, float src, float da, float s
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_SoftLight_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_SoftLight_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -3359,7 +3359,7 @@ static inline void comp_func_solid_SoftLight_impl(QRgba32F *dest, int length, QR
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) soft_light_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -3369,11 +3369,11 @@ static inline void comp_func_solid_SoftLight_impl(QRgba32F *dest, int length, QR
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_SoftLight_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_SoftLight_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_SoftLight_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -3444,11 +3444,11 @@ void QT_FASTCALL comp_func_SoftLight_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_SoftLight_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_SoftLight_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -3460,11 +3460,11 @@ static inline void comp_func_SoftLight_impl(QRgba32F *Q_DECL_RESTRICT dest, cons
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_SoftLight_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_SoftLight_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_SoftLight_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -3558,7 +3558,7 @@ static inline float difference_op_rgbafp(float dst, float src, float da, float s
|
|||
}
|
||||
|
||||
template <typename T>
|
||||
static inline void comp_func_solid_Difference_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void comp_func_solid_Difference_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -3566,7 +3566,7 @@ static inline void comp_func_solid_Difference_impl(QRgba32F *dest, int length, Q
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) difference_op_rgbafp(a, b, da, sa)
|
||||
|
|
@ -3576,11 +3576,11 @@ static inline void comp_func_solid_Difference_impl(QRgba32F *dest, int length, Q
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_Difference_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Difference_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_Difference_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -3651,11 +3651,11 @@ void QT_FASTCALL comp_func_Difference_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_Difference_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_Difference_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -3667,11 +3667,11 @@ static inline void comp_func_Difference_impl(QRgba32F *Q_DECL_RESTRICT dest, con
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Difference_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Difference_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_Difference_impl(dest, src, length, QFullCoverage());
|
||||
|
|
@ -3749,7 +3749,7 @@ void QT_FASTCALL comp_func_solid_Exclusion_rgb64(QRgba64 *dest, int length, QRgb
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgba32F *dest, int length, QRgba32F color, const T &coverage)
|
||||
static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, const T &coverage)
|
||||
{
|
||||
float sa = color.alpha();
|
||||
float sr = color.red();
|
||||
|
|
@ -3757,7 +3757,7 @@ static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgba32F *dest, in
|
|||
float sb = color.blue();
|
||||
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
float da = d.alpha();
|
||||
|
||||
#define OP(a, b) (a + b - (2.0f * a * b))
|
||||
|
|
@ -3767,11 +3767,11 @@ static inline void QT_FASTCALL comp_func_solid_Exclusion_impl(QRgba32F *dest, in
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_Exclusion_rgbafp(QRgba32F *dest, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Exclusion_rgbafp(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_solid_Exclusion_impl(dest, length, color, QFullCoverage());
|
||||
|
|
@ -3842,11 +3842,11 @@ void QT_FASTCALL comp_func_Exclusion_rgb64(QRgba64 *Q_DECL_RESTRICT dest, const
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template <typename T>
|
||||
static inline void comp_func_Exclusion_impl(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
static inline void comp_func_Exclusion_impl(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, const T &coverage)
|
||||
{
|
||||
for (int i = 0; i < length; ++i) {
|
||||
QRgba32F d = dest[i];
|
||||
QRgba32F s = src[i];
|
||||
QRgbaFloat32 d = dest[i];
|
||||
QRgbaFloat32 s = src[i];
|
||||
|
||||
float da = d.alpha();
|
||||
float sa = s.alpha();
|
||||
|
|
@ -3858,11 +3858,11 @@ static inline void comp_func_Exclusion_impl(QRgba32F *Q_DECL_RESTRICT dest, cons
|
|||
float a = mix_alpha_rgbafp(da, sa);
|
||||
#undef OP
|
||||
|
||||
coverage.store(&dest[i], qRgba32f(r, g, b, a));
|
||||
coverage.store(&dest[i], qRgbaFloat32(r, g, b, a));
|
||||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_Exclusion_rgbafp(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Exclusion_rgbafp(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha)
|
||||
{
|
||||
if (const_alpha == 255)
|
||||
comp_func_Exclusion_impl(dest, src, length, QFullCoverage());
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ template <>
|
|||
inline uint QT_FASTCALL fetch1Pixel<QPixelLayout::BPP16FPx4>(const uchar *src, int index)
|
||||
{
|
||||
// We have to do the conversion in fetch to fit into a 32bit uint
|
||||
QRgba16F c = reinterpret_cast<const QRgba16F *>(src)[index];
|
||||
QRgbaFloat16 c = reinterpret_cast<const QRgbaFloat16 *>(src)[index];
|
||||
return c.toArgb32();
|
||||
}
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ template <>
|
|||
inline uint QT_FASTCALL fetch1Pixel<QPixelLayout::BPP32FPx4>(const uchar *src, int index)
|
||||
{
|
||||
// We have to do the conversion in fetch to fit into a 32bit uint
|
||||
QRgba32F c = reinterpret_cast<const QRgba32F *>(src)[index];
|
||||
QRgbaFloat32 c = reinterpret_cast<const QRgbaFloat32 *>(src)[index];
|
||||
return c.toArgb32();
|
||||
}
|
||||
|
||||
|
|
@ -169,36 +169,36 @@ static void QT_FASTCALL convertRGBA64PMToRGBA64PM(QRgba64 *, int)
|
|||
|
||||
static void QT_FASTCALL convertRGBA16FToRGBA64PM(QRgba64 *buffer, int count)
|
||||
{
|
||||
const QRgba16F *in = reinterpret_cast<const QRgba16F *>(buffer);
|
||||
const QRgbaFloat16 *in = reinterpret_cast<const QRgbaFloat16 *>(buffer);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba16F c = in[i];
|
||||
QRgbaFloat16 c = in[i];
|
||||
buffer[i] = QRgba64::fromRgba64(c.red16(), c.green16(), c.blue16(), c.alpha16()).premultiplied();
|
||||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL convertRGBA16FPMToRGBA64PM(QRgba64 *buffer, int count)
|
||||
{
|
||||
const QRgba16F *in = reinterpret_cast<const QRgba16F *>(buffer);
|
||||
const QRgbaFloat16 *in = reinterpret_cast<const QRgbaFloat16 *>(buffer);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba16F c = in[i];
|
||||
QRgbaFloat16 c = in[i];
|
||||
buffer[i] = QRgba64::fromRgba64(c.red16(), c.green16(), c.blue16(), c.alpha16());
|
||||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL convertRGBA32FToRGBA64PM(QRgba64 *buffer, int count)
|
||||
{
|
||||
const QRgba32F *in = reinterpret_cast<const QRgba32F *>(buffer);
|
||||
const QRgbaFloat32 *in = reinterpret_cast<const QRgbaFloat32 *>(buffer);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba32F c = in[i];
|
||||
QRgbaFloat32 c = in[i];
|
||||
buffer[i] = QRgba64::fromRgba64(c.red16(), c.green16(), c.blue16(), c.alpha16()).premultiplied();
|
||||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL convertRGBA32FPMToRGBA64PM(QRgba64 *buffer, int count)
|
||||
{
|
||||
const QRgba32F *in = reinterpret_cast<const QRgba32F *>(buffer);
|
||||
const QRgbaFloat32 *in = reinterpret_cast<const QRgbaFloat32 *>(buffer);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba32F c = in[i];
|
||||
QRgbaFloat32 c = in[i];
|
||||
buffer[i] = QRgba64::fromRgba64(c.red16(), c.green16(), c.blue16(), c.alpha16());
|
||||
}
|
||||
}
|
||||
|
|
@ -244,32 +244,32 @@ static Convert64Func convert64ToRGBA64PM[QImage::NImageFormats] = {
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static void QT_FASTCALL convertRGBA64PMToRGBA32F(QRgba32F *buffer, const quint64 *src, int count)
|
||||
static void QT_FASTCALL convertRGBA64PMToRGBA32F(QRgbaFloat32 *buffer, const quint64 *src, int count)
|
||||
{
|
||||
const auto *in = reinterpret_cast<const QRgba64 *>(src);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
auto c = in[i];
|
||||
buffer[i] = QRgba32F::fromRgba64(c.red(), c.green(), c.blue(), c.alpha()).premultiplied();
|
||||
buffer[i] = QRgbaFloat32::fromRgba64(c.red(), c.green(), c.blue(), c.alpha()).premultiplied();
|
||||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL convertRGBA64ToRGBA32F(QRgba32F *buffer, const quint64 *src, int count)
|
||||
static void QT_FASTCALL convertRGBA64ToRGBA32F(QRgbaFloat32 *buffer, const quint64 *src, int count)
|
||||
{
|
||||
const auto *in = reinterpret_cast<const QRgba64 *>(src);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
auto c = in[i];
|
||||
buffer[i] = QRgba32F::fromRgba64(c.red(), c.green(), c.blue(), c.alpha());
|
||||
buffer[i] = QRgbaFloat32::fromRgba64(c.red(), c.green(), c.blue(), c.alpha());
|
||||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL convertRGBA16FPMToRGBA32F(QRgba32F *buffer, const quint64 *src, int count)
|
||||
static void QT_FASTCALL convertRGBA16FPMToRGBA32F(QRgbaFloat32 *buffer, const quint64 *src, int count)
|
||||
{
|
||||
qFloatFromFloat16((float *)buffer, (const qfloat16 *)src, count * 4);
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = buffer[i].premultiplied();
|
||||
}
|
||||
|
||||
static void QT_FASTCALL convertRGBA16FToRGBA32F(QRgba32F *buffer, const quint64 *src, int count)
|
||||
static void QT_FASTCALL convertRGBA16FToRGBA32F(QRgbaFloat32 *buffer, const quint64 *src, int count)
|
||||
{
|
||||
qFloatFromFloat16((float *)buffer, (const qfloat16 *)src, count * 4);
|
||||
}
|
||||
|
|
@ -313,13 +313,13 @@ static Convert64ToFPFunc convert64ToRGBA32F[QImage::NImageFormats] = {
|
|||
nullptr,
|
||||
};
|
||||
|
||||
static void convertRGBA32FToRGBA32FPM(QRgba32F *buffer, int count)
|
||||
static void convertRGBA32FToRGBA32FPM(QRgbaFloat32 *buffer, int count)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = buffer[i].premultiplied();
|
||||
}
|
||||
|
||||
static void convertRGBA32FToRGBA32F(QRgba32F *, int)
|
||||
static void convertRGBA32FToRGBA32F(QRgbaFloat32 *, int)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -479,12 +479,12 @@ static DestFetchProc64 destFetchProc64[QImage::NImageFormats] =
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static QRgba32F *QT_FASTCALL destFetchFP(QRgba32F *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
|
||||
static QRgbaFloat32 *QT_FASTCALL destFetchFP(QRgbaFloat32 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length)
|
||||
{
|
||||
return const_cast<QRgba32F *>(qFetchToRGBA32F[rasterBuffer->format](buffer, rasterBuffer->scanLine(y), x, length, nullptr, nullptr));
|
||||
return const_cast<QRgbaFloat32 *>(qFetchToRGBA32F[rasterBuffer->format](buffer, rasterBuffer->scanLine(y), x, length, nullptr, nullptr));
|
||||
}
|
||||
|
||||
static QRgba32F *QT_FASTCALL destFetchFPUndefined(QRgba32F *buffer, QRasterBuffer *, int, int, int)
|
||||
static QRgbaFloat32 *QT_FASTCALL destFetchFPUndefined(QRgbaFloat32 *buffer, QRasterBuffer *, int, int, int)
|
||||
{
|
||||
return buffer;
|
||||
}
|
||||
|
|
@ -783,7 +783,7 @@ static DestStoreProc64 destStoreProc64[QImage::NImageFormats] =
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static void QT_FASTCALL destStoreFP(QRasterBuffer *rasterBuffer, int x, int y, const QRgba32F *buffer, int length)
|
||||
static void QT_FASTCALL destStoreFP(QRasterBuffer *rasterBuffer, int x, int y, const QRgbaFloat32 *buffer, int length)
|
||||
{
|
||||
auto store = qStoreFromRGBA32F[rasterBuffer->format];
|
||||
uchar *dest = rasterBuffer->scanLine(y);
|
||||
|
|
@ -857,7 +857,7 @@ static const QRgba64 *QT_FASTCALL fetchUntransformedRGBA64PM(QRgba64 *, const Op
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static const QRgba32F *QT_FASTCALL fetchUntransformedFP(QRgba32F *buffer, const Operator *,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchUntransformedFP(QRgbaFloat32 *buffer, const Operator *,
|
||||
const QSpanData *data, int y, int x, int length)
|
||||
{
|
||||
const auto fetch = qFetchToRGBA32F[data->texture.format];
|
||||
|
|
@ -1096,7 +1096,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformed64(QRgba64 *buffer, const Oper
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
template<TextureBlendType blendType> /* either BlendTransformed or BlendTransformedTiled */
|
||||
static const QRgba32F *QT_FASTCALL fetchTransformedFP(QRgba32F *buffer, const Operator *, const QSpanData *data,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchTransformedFP(QRgbaFloat32 *buffer, const Operator *, const QSpanData *data,
|
||||
int y, int x, int length)
|
||||
{
|
||||
const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
|
||||
|
|
@ -1113,7 +1113,7 @@ static const QRgba32F *QT_FASTCALL fetchTransformedFP(QRgba32F *buffer, const Op
|
|||
fetchTransformed_fetcher<blendType, QPixelLayout::BPP64, quint64>(buffer64, data, y, x, length);
|
||||
convert64ToRGBA32F[data->texture.format](buffer, buffer64, length);
|
||||
} else {
|
||||
fetchTransformed_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgba32F>(buffer, data, y, x, length);
|
||||
fetchTransformed_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>(buffer, data, y, x, length);
|
||||
if (data->texture.format == QImage::Format_RGBA32FPx4)
|
||||
convertRGBA32FToRGBA32FPM(buffer, length);
|
||||
return buffer;
|
||||
|
|
@ -2703,8 +2703,8 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64_f32x4(QRgba64 *buff
|
|||
const qreal cx = x + qreal(0.5);
|
||||
const qreal cy = y + qreal(0.5);
|
||||
|
||||
QRgba32F sbuf1[BufferSize];
|
||||
QRgba32F sbuf2[BufferSize];
|
||||
QRgbaFloat32 sbuf1[BufferSize];
|
||||
QRgbaFloat32 sbuf2[BufferSize];
|
||||
alignas(8) QRgba64 buf1[BufferSize];
|
||||
alignas(8) QRgba64 buf2[BufferSize];
|
||||
QRgba64 *b = buffer;
|
||||
|
|
@ -2720,7 +2720,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64_f32x4(QRgba64 *buff
|
|||
fx -= half_point;
|
||||
fy -= half_point;
|
||||
|
||||
const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgba32F>;
|
||||
const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
|
||||
|
||||
const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
|
||||
while (length) {
|
||||
|
|
@ -2744,7 +2744,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64_f32x4(QRgba64 *buff
|
|||
b += len;
|
||||
}
|
||||
} else { // !(data->fast_matrix)
|
||||
const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgba32F>;
|
||||
const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
|
||||
|
||||
const qreal fdx = data->m11;
|
||||
const qreal fdy = data->m12;
|
||||
|
|
@ -2794,7 +2794,7 @@ static const QRgba64 *QT_FASTCALL fetchTransformedBilinear64(QRgba64 *buffer, co
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static void interpolate_simple_rgba32f(QRgba32F *b, const QRgba32F *buf1, const QRgba32F *buf2, int len,
|
||||
static void interpolate_simple_rgba32f(QRgbaFloat32 *b, const QRgbaFloat32 *buf1, const QRgbaFloat32 *buf2, int len,
|
||||
int &fx, int fdx,
|
||||
int &fy, int fdy)
|
||||
{
|
||||
|
|
@ -2807,7 +2807,7 @@ static void interpolate_simple_rgba32f(QRgba32F *b, const QRgba32F *buf1, const
|
|||
}
|
||||
}
|
||||
|
||||
static void interpolate_perspective_rgba32f(QRgba32F *b, const QRgba32F *buf1, const QRgba32F *buf2, int len,
|
||||
static void interpolate_perspective_rgba32f(QRgbaFloat32 *b, const QRgbaFloat32 *buf1, const QRgbaFloat32 *buf2, int len,
|
||||
unsigned short *distxs,
|
||||
unsigned short *distys)
|
||||
{
|
||||
|
|
@ -2819,7 +2819,7 @@ static void interpolate_perspective_rgba32f(QRgba32F *b, const QRgba32F *buf1, c
|
|||
}
|
||||
|
||||
template<TextureBlendType blendType>
|
||||
static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP_uint32(QRgba32F *buffer, const QSpanData *data,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchTransformedBilinearFP_uint32(QRgbaFloat32 *buffer, const QSpanData *data,
|
||||
int y, int x, int length)
|
||||
{
|
||||
const QPixelLayout *layout = &qPixelLayouts[data->texture.format];
|
||||
|
|
@ -2831,9 +2831,9 @@ static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP_uint32(QRgba32F *b
|
|||
|
||||
uint sbuf1[BufferSize];
|
||||
uint sbuf2[BufferSize];
|
||||
QRgba32F buf1[BufferSize];
|
||||
QRgba32F buf2[BufferSize];
|
||||
QRgba32F *b = buffer;
|
||||
QRgbaFloat32 buf1[BufferSize];
|
||||
QRgbaFloat32 buf2[BufferSize];
|
||||
QRgbaFloat32 *b = buffer;
|
||||
|
||||
if (canUseFastMatrixPath(cx, cy, length, data)) {
|
||||
// The increment pr x in the scanline
|
||||
|
|
@ -2897,7 +2897,7 @@ static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP_uint32(QRgba32F *b
|
|||
}
|
||||
|
||||
template<TextureBlendType blendType>
|
||||
static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP_uint64(QRgba32F *buffer, const QSpanData *data,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchTransformedBilinearFP_uint64(QRgbaFloat32 *buffer, const QSpanData *data,
|
||||
int y, int x, int length)
|
||||
{
|
||||
const auto convert = convert64ToRGBA32F[data->texture.format];
|
||||
|
|
@ -2907,9 +2907,9 @@ static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP_uint64(QRgba32F *b
|
|||
|
||||
quint64 sbuf1[BufferSize];
|
||||
quint64 sbuf2[BufferSize];
|
||||
QRgba32F buf1[BufferSize];
|
||||
QRgba32F buf2[BufferSize];
|
||||
QRgba32F *b = buffer;
|
||||
QRgbaFloat32 buf1[BufferSize];
|
||||
QRgbaFloat32 buf2[BufferSize];
|
||||
QRgbaFloat32 *b = buffer;
|
||||
|
||||
if (canUseFastMatrixPath(cx, cy, length, data)) {
|
||||
// The increment pr x in the scanline
|
||||
|
|
@ -2968,7 +2968,7 @@ static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP_uint64(QRgba32F *b
|
|||
}
|
||||
|
||||
template<TextureBlendType blendType>
|
||||
static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP(QRgba32F *buffer, const QSpanData *data,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchTransformedBilinearFP(QRgbaFloat32 *buffer, const QSpanData *data,
|
||||
int y, int x, int length)
|
||||
{
|
||||
const auto convert = data->rasterBuffer->format == QImage::Format_RGBA32FPx4 ? convertRGBA32FToRGBA32FPM
|
||||
|
|
@ -2977,9 +2977,9 @@ static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP(QRgba32F *buffer,
|
|||
const qreal cx = x + qreal(0.5);
|
||||
const qreal cy = y + qreal(0.5);
|
||||
|
||||
QRgba32F buf1[BufferSize];
|
||||
QRgba32F buf2[BufferSize];
|
||||
QRgba32F *b = buffer;
|
||||
QRgbaFloat32 buf1[BufferSize];
|
||||
QRgbaFloat32 buf2[BufferSize];
|
||||
QRgbaFloat32 *b = buffer;
|
||||
|
||||
if (canUseFastMatrixPath(cx, cy, length, data)) {
|
||||
// The increment pr x in the scanline
|
||||
|
|
@ -2991,7 +2991,7 @@ static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP(QRgba32F *buffer,
|
|||
|
||||
fx -= half_point;
|
||||
fy -= half_point;
|
||||
const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgba32F>;
|
||||
const auto fetcher = fetchTransformedBilinear_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
|
||||
|
||||
const bool skipsecond = (fdy == 0) && ((fy & 0x0000ffff) == 0);
|
||||
while (length) {
|
||||
|
|
@ -3008,7 +3008,7 @@ static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP(QRgba32F *buffer,
|
|||
b += len;
|
||||
}
|
||||
} else { // !(data->fast_matrix)
|
||||
const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgba32F>;
|
||||
const auto fetcher = fetchTransformedBilinear_slow_fetcher<blendType, QPixelLayout::BPP32FPx4, QRgbaFloat32>;
|
||||
|
||||
const qreal fdx = data->m11;
|
||||
const qreal fdy = data->m12;
|
||||
|
|
@ -3038,7 +3038,7 @@ static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP(QRgba32F *buffer,
|
|||
}
|
||||
|
||||
template<TextureBlendType blendType>
|
||||
static const QRgba32F *QT_FASTCALL fetchTransformedBilinearFP(QRgba32F *buffer, const Operator *,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchTransformedBilinearFP(QRgbaFloat32 *buffer, const Operator *,
|
||||
const QSpanData *data, int y, int x, int length)
|
||||
{
|
||||
switch (qPixelLayouts[data->texture.format].bpp) {
|
||||
|
|
@ -3204,18 +3204,18 @@ static const QRgba64& qt_gradient_pixel64_fixed(const QGradientData *data, int f
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static inline QRgba32F qt_gradient_pixelFP(const QGradientData *data, qreal pos)
|
||||
static inline QRgbaFloat32 qt_gradient_pixelFP(const QGradientData *data, qreal pos)
|
||||
{
|
||||
int ipos = int(pos * (GRADIENT_STOPTABLE_SIZE - 1) + qreal(0.5));
|
||||
QRgba64 rgb64 = data->colorTable64[qt_gradient_clamp(data, ipos)];
|
||||
return QRgba32F::fromRgba64(rgb64.red(),rgb64.green(), rgb64.blue(), rgb64.alpha());
|
||||
return QRgbaFloat32::fromRgba64(rgb64.red(),rgb64.green(), rgb64.blue(), rgb64.alpha());
|
||||
}
|
||||
|
||||
static inline QRgba32F qt_gradient_pixelFP_fixed(const QGradientData *data, int fixed_pos)
|
||||
static inline QRgbaFloat32 qt_gradient_pixelFP_fixed(const QGradientData *data, int fixed_pos)
|
||||
{
|
||||
int ipos = (fixed_pos + (FIXPT_SIZE / 2)) >> FIXPT_BITS;
|
||||
QRgba64 rgb64 = data->colorTable64[qt_gradient_clamp(data, ipos)];
|
||||
return QRgba32F::fromRgba64(rgb64.red(), rgb64.green(), rgb64.blue(), rgb64.alpha());
|
||||
return QRgbaFloat32::fromRgba64(rgb64.red(), rgb64.green(), rgb64.blue(), rgb64.alpha());
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3276,8 +3276,8 @@ public:
|
|||
class GradientBaseFP
|
||||
{
|
||||
public:
|
||||
typedef QRgba32F Type;
|
||||
static Type null() { return QRgba32F::fromRgba64(0,0,0,0); }
|
||||
typedef QRgbaFloat32 Type;
|
||||
static Type null() { return QRgbaFloat32::fromRgba64(0,0,0,0); }
|
||||
static Type fetchSingle(const QGradientData& gradient, qreal v)
|
||||
{
|
||||
return qt_gradient_pixelFP(&gradient, v);
|
||||
|
|
@ -3381,10 +3381,10 @@ static const QRgba64 * QT_FASTCALL qt_fetch_linear_gradient_rgb64(QRgba64 *buffe
|
|||
}
|
||||
#endif
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static const QRgba32F * QT_FASTCALL qt_fetch_linear_gradient_rgbfp(QRgba32F *buffer, const Operator *op, const QSpanData *data,
|
||||
static const QRgbaFloat32 * QT_FASTCALL qt_fetch_linear_gradient_rgbfp(QRgbaFloat32 *buffer, const Operator *op, const QSpanData *data,
|
||||
int y, int x, int length)
|
||||
{
|
||||
return qt_fetch_linear_gradient_template<GradientBaseFP, QRgba32F>(buffer, op, data, y, x, length);
|
||||
return qt_fetch_linear_gradient_template<GradientBaseFP, QRgbaFloat32>(buffer, op, data, y, x, length);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3457,10 +3457,10 @@ const QRgba64 * QT_FASTCALL qt_fetch_radial_gradient_rgb64(QRgba64 *buffer, cons
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static const QRgba32F * QT_FASTCALL qt_fetch_radial_gradient_rgbfp(QRgba32F *buffer, const Operator *op, const QSpanData *data,
|
||||
static const QRgbaFloat32 * QT_FASTCALL qt_fetch_radial_gradient_rgbfp(QRgbaFloat32 *buffer, const Operator *op, const QSpanData *data,
|
||||
int y, int x, int length)
|
||||
{
|
||||
return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBaseFP>, QRgba32F>(buffer, op, data, y, x, length);
|
||||
return qt_fetch_radial_gradient_template<RadialFetchPlain<GradientBaseFP>, QRgbaFloat32>(buffer, op, data, y, x, length);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3530,10 +3530,10 @@ static const QRgba64 * QT_FASTCALL qt_fetch_conical_gradient_rgb64(QRgba64 *buff
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static const QRgba32F * QT_FASTCALL qt_fetch_conical_gradient_rgbfp(QRgba32F *buffer, const Operator *, const QSpanData *data,
|
||||
static const QRgbaFloat32 * QT_FASTCALL qt_fetch_conical_gradient_rgbfp(QRgbaFloat32 *buffer, const Operator *, const QSpanData *data,
|
||||
int y, int x, int length)
|
||||
{
|
||||
return qt_fetch_conical_gradient_template<GradientBaseFP, QRgba32F>(buffer, data, y, x, length);
|
||||
return qt_fetch_conical_gradient_template<GradientBaseFP, QRgbaFloat32>(buffer, data, y, x, length);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -3720,7 +3720,7 @@ static void spanfill_from_first(QRasterBuffer *rasterBuffer, QPixelLayout::BPP b
|
|||
{
|
||||
switch (bpp) {
|
||||
case QPixelLayout::BPP32FPx4: {
|
||||
QRgba32F *dest = reinterpret_cast<QRgba32F *>(rasterBuffer->scanLine(y)) + x;
|
||||
QRgbaFloat32 *dest = reinterpret_cast<QRgbaFloat32 *>(rasterBuffer->scanLine(y)) + x;
|
||||
qt_memfill_template(dest + 1, dest[0], length - 1);
|
||||
break;
|
||||
}
|
||||
|
|
@ -3876,8 +3876,8 @@ static void blend_color_generic_fp(int count, const QSpan *spans, void *userData
|
|||
return blend_color_generic(count, spans, userData);
|
||||
}
|
||||
|
||||
QRgba32F buffer[BufferSize];
|
||||
const QRgba32F color = qConvertRgb64ToRgbaF32(data->solidColor);
|
||||
QRgbaFloat32 buffer[BufferSize];
|
||||
const QRgbaFloat32 color = qConvertRgb64ToRgbaF32(data->solidColor);
|
||||
const bool solidFill = op.mode == QPainter::CompositionMode_Source;
|
||||
QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
|
||||
|
||||
|
|
@ -3893,7 +3893,7 @@ static void blend_color_generic_fp(int count, const QSpan *spans, void *userData
|
|||
|
||||
while (length) {
|
||||
int l = qMin(BufferSize, length);
|
||||
QRgba32F *dest = op.destFetchFP(buffer, data->rasterBuffer, x, spans->y, l);
|
||||
QRgbaFloat32 *dest = op.destFetchFP(buffer, data->rasterBuffer, x, spans->y, l);
|
||||
op.funcSolidFP(dest, l, color, spans->coverage);
|
||||
if (op.destStoreFP)
|
||||
op.destStoreFP(data->rasterBuffer, x, spans->y, dest, l);
|
||||
|
|
@ -4037,9 +4037,9 @@ public:
|
|||
class BlendSrcGenericRGBFP : public QBlendBase
|
||||
{
|
||||
public:
|
||||
QRgba32F *dest = nullptr;
|
||||
alignas(16) QRgba32F buffer[BufferSize];
|
||||
alignas(16) QRgba32F src_buffer[BufferSize];
|
||||
QRgbaFloat32 *dest = nullptr;
|
||||
alignas(16) QRgbaFloat32 buffer[BufferSize];
|
||||
alignas(16) QRgbaFloat32 src_buffer[BufferSize];
|
||||
BlendSrcGenericRGBFP(QSpanData *d, const Operator &o)
|
||||
: QBlendBase{d, o}
|
||||
{
|
||||
|
|
@ -4050,13 +4050,13 @@ public:
|
|||
return op.funcFP && op.destFetchFP && op.srcFetchFP;
|
||||
}
|
||||
|
||||
const QRgba32F *fetch(int x, int y, int len)
|
||||
const QRgbaFloat32 *fetch(int x, int y, int len)
|
||||
{
|
||||
dest = op.destFetchFP(buffer, data->rasterBuffer, x, y, len);
|
||||
return op.srcFetchFP(src_buffer, &op, data, y, x, len);
|
||||
}
|
||||
|
||||
void process(int, int, int len, int coverage, const QRgba32F *src, int offset)
|
||||
void process(int, int, int len, int coverage, const QRgbaFloat32 *src, int offset)
|
||||
{
|
||||
op.funcFP(dest + offset, src + offset, len, coverage);
|
||||
}
|
||||
|
|
@ -4216,8 +4216,8 @@ static void blend_untransformed_generic_fp(int count, const QSpan *spans, void *
|
|||
qCDebug(lcQtGuiDrawHelper, "blend_untransformed_generic_rgbaf16: unsupported 4xFP16 blend attempted, falling back to 32-bit");
|
||||
return blend_untransformed_generic(count, spans, userData);
|
||||
}
|
||||
QRgba32F buffer[BufferSize];
|
||||
QRgba32F src_buffer[BufferSize];
|
||||
QRgbaFloat32 buffer[BufferSize];
|
||||
QRgbaFloat32 src_buffer[BufferSize];
|
||||
|
||||
const int image_width = data->texture.width;
|
||||
const int image_height = data->texture.height;
|
||||
|
|
@ -4243,8 +4243,8 @@ static void blend_untransformed_generic_fp(int count, const QSpan *spans, void *
|
|||
const int coverage = (spans->coverage * data->texture.const_alpha) >> 8;
|
||||
while (length) {
|
||||
int l = qMin(BufferSize, length);
|
||||
const QRgba32F *src = op.srcFetchFP(src_buffer, &op, data, sy, sx, l);
|
||||
QRgba32F *dest = op.destFetchFP(buffer, data->rasterBuffer, x, spans->y, l);
|
||||
const QRgbaFloat32 *src = op.srcFetchFP(src_buffer, &op, data, sy, sx, l);
|
||||
QRgbaFloat32 *dest = op.destFetchFP(buffer, data->rasterBuffer, x, spans->y, l);
|
||||
op.funcFP(dest, src, l, coverage);
|
||||
if (op.destStoreFP)
|
||||
op.destStoreFP(data->rasterBuffer, x, spans->y, dest, l);
|
||||
|
|
@ -4571,8 +4571,8 @@ static void blend_tiled_generic_fp(int count, const QSpan *spans, void *userData
|
|||
qCDebug(lcQtGuiDrawHelper, "blend_tiled_generic_fp: unsupported 4xFP blend attempted, falling back to 32-bit");
|
||||
return blend_tiled_generic(count, spans, userData);
|
||||
}
|
||||
QRgba32F buffer[BufferSize];
|
||||
QRgba32F src_buffer[BufferSize];
|
||||
QRgbaFloat32 buffer[BufferSize];
|
||||
QRgbaFloat32 src_buffer[BufferSize];
|
||||
|
||||
const int image_width = data->texture.width;
|
||||
const int image_height = data->texture.height;
|
||||
|
|
@ -4601,8 +4601,8 @@ static void blend_tiled_generic_fp(int count, const QSpan *spans, void *userData
|
|||
int l = qMin(image_width - sx, length);
|
||||
if (BufferSize < l)
|
||||
l = BufferSize;
|
||||
const QRgba32F *src = op.srcFetchFP(src_buffer, &op, data, sy, sx, l);
|
||||
QRgba32F *dest = op.destFetchFP(buffer, data->rasterBuffer, x, spans->y, l);
|
||||
const QRgbaFloat32 *src = op.srcFetchFP(src_buffer, &op, data, sy, sx, l);
|
||||
QRgbaFloat32 *dest = op.destFetchFP(buffer, data->rasterBuffer, x, spans->y, l);
|
||||
op.funcFP(dest, src, l, coverage);
|
||||
if (op.destStoreFP)
|
||||
op.destStoreFP(data->rasterBuffer, x, spans->y, dest, l);
|
||||
|
|
@ -5849,9 +5849,9 @@ static void qt_rectfill_fp32x4(QRasterBuffer *rasterBuffer,
|
|||
const QRgba64 &color)
|
||||
{
|
||||
const auto store = qStoreFromRGBA64PM[rasterBuffer->format];
|
||||
QRgba32F c;
|
||||
QRgbaFloat32 c;
|
||||
store(reinterpret_cast<uchar *>(&c), &color, 0, 1, nullptr, nullptr);
|
||||
qt_rectfill<QRgba32F>(reinterpret_cast<QRgba32F *>(rasterBuffer->buffer()),
|
||||
qt_rectfill<QRgbaFloat32>(reinterpret_cast<QRgbaFloat32 *>(rasterBuffer->buffer()),
|
||||
c, x, y, width, height, rasterBuffer->bytesPerLine());
|
||||
}
|
||||
|
||||
|
|
@ -6358,9 +6358,9 @@ static void qInitDrawhelperFunctions()
|
|||
destStoreProc64[QImage::Format_RGBA8888] = destStore64RGBA8888_sse4;
|
||||
#endif
|
||||
#if QT_CONFIG(raster_fp)
|
||||
extern const QRgba32F *QT_FASTCALL fetchRGBA32FToRGBA32F_sse4(QRgba32F *buffer, const uchar *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern void QT_FASTCALL storeRGBX32FFromRGBA32F_sse4(uchar *dest, const QRgba32F *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern void QT_FASTCALL storeRGBA32FFromRGBA32F_sse4(uchar *dest, const QRgba32F *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern const QRgbaFloat32 *QT_FASTCALL fetchRGBA32FToRGBA32F_sse4(QRgbaFloat32 *buffer, const uchar *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern void QT_FASTCALL storeRGBX32FFromRGBA32F_sse4(uchar *dest, const QRgbaFloat32 *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern void QT_FASTCALL storeRGBA32FFromRGBA32F_sse4(uchar *dest, const QRgbaFloat32 *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
qFetchToRGBA32F[QImage::Format_RGBA32FPx4] = fetchRGBA32FToRGBA32F_sse4;
|
||||
qStoreFromRGBA32F[QImage::Format_RGBX32FPx4] = storeRGBX32FFromRGBA32F_sse4;
|
||||
qStoreFromRGBA32F[QImage::Format_RGBA32FPx4] = storeRGBA32FFromRGBA32F_sse4;
|
||||
|
|
@ -6402,10 +6402,10 @@ static void qInitDrawhelperFunctions()
|
|||
qt_functionForModeSolid64_C[QPainter::CompositionMode_SourceOver] = comp_func_solid_SourceOver_rgb64_avx2;
|
||||
#endif
|
||||
#if QT_CONFIG(raster_fp)
|
||||
extern void QT_FASTCALL comp_func_Source_rgbafp_avx2(QRgba32F *destPixels, const QRgba32F *srcPixels, int length, uint const_alpha);
|
||||
extern void QT_FASTCALL comp_func_SourceOver_rgbafp_avx2(QRgba32F *destPixels, const QRgba32F *srcPixels, int length, uint const_alpha);
|
||||
extern void QT_FASTCALL comp_func_solid_Source_rgbafp_avx2(QRgba32F *destPixels, int length, QRgba32F color, uint const_alpha);
|
||||
extern void QT_FASTCALL comp_func_solid_SourceOver_rgbafp_avx2(QRgba32F *destPixels, int length, QRgba32F color, uint const_alpha);
|
||||
extern void QT_FASTCALL comp_func_Source_rgbafp_avx2(QRgbaFloat32 *destPixels, const QRgbaFloat32 *srcPixels, int length, uint const_alpha);
|
||||
extern void QT_FASTCALL comp_func_SourceOver_rgbafp_avx2(QRgbaFloat32 *destPixels, const QRgbaFloat32 *srcPixels, int length, uint const_alpha);
|
||||
extern void QT_FASTCALL comp_func_solid_Source_rgbafp_avx2(QRgbaFloat32 *destPixels, int length, QRgbaFloat32 color, uint const_alpha);
|
||||
extern void QT_FASTCALL comp_func_solid_SourceOver_rgbafp_avx2(QRgbaFloat32 *destPixels, int length, QRgbaFloat32 color, uint const_alpha);
|
||||
qt_functionForModeFP_C[QPainter::CompositionMode_Source] = comp_func_Source_rgbafp_avx2;
|
||||
qt_functionForModeFP_C[QPainter::CompositionMode_SourceOver] = comp_func_SourceOver_rgbafp_avx2;
|
||||
qt_functionForModeSolidFP_C[QPainter::CompositionMode_Source] = comp_func_solid_Source_rgbafp_avx2;
|
||||
|
|
@ -6464,9 +6464,9 @@ static void qInitDrawhelperFunctions()
|
|||
qPixelLayouts[QImage::Format_RGBA16FPx4_Premultiplied].storeFromARGB32PM = storeRGB16FFromRGB32_avx2;
|
||||
qPixelLayouts[QImage::Format_RGBA16FPx4_Premultiplied].storeFromRGB32 = storeRGB16FFromRGB32_avx2;
|
||||
#if QT_CONFIG(raster_fp)
|
||||
extern const QRgba32F *QT_FASTCALL fetchRGBA16FToRGBA32F_avx2(QRgba32F *buffer, const uchar *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern void QT_FASTCALL storeRGBX16FFromRGBA32F_avx2(uchar *dest, const QRgba32F *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern void QT_FASTCALL storeRGBA16FFromRGBA32F_avx2(uchar *dest, const QRgba32F *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern const QRgbaFloat32 *QT_FASTCALL fetchRGBA16FToRGBA32F_avx2(QRgbaFloat32 *buffer, const uchar *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern void QT_FASTCALL storeRGBX16FFromRGBA32F_avx2(uchar *dest, const QRgbaFloat32 *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
extern void QT_FASTCALL storeRGBA16FFromRGBA32F_avx2(uchar *dest, const QRgbaFloat32 *src, int index, int count, const QList<QRgb> *, QDitherInfo *);
|
||||
qFetchToRGBA32F[QImage::Format_RGBA16FPx4] = fetchRGBA16FToRGBA32F_avx2;
|
||||
qStoreFromRGBA32F[QImage::Format_RGBX16FPx4] = storeRGBX16FFromRGBA32F_avx2;
|
||||
qStoreFromRGBA32F[QImage::Format_RGBA16FPx4] = storeRGBA16FFromRGBA32F_avx2;
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ void QT_FASTCALL comp_func_SourceOver_rgb64_avx2(QRgba64 *dst, const QRgba64 *sr
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_SourceOver_rgbafp_avx2(QRgba32F *dst, const QRgba32F *src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_SourceOver_rgbafp_avx2(QRgbaFloat32 *dst, const QRgbaFloat32 *src, int length, uint const_alpha)
|
||||
{
|
||||
Q_ASSERT(const_alpha < 256); // const_alpha is in [0-255]
|
||||
|
||||
|
|
@ -557,11 +557,11 @@ void QT_FASTCALL comp_func_Source_rgb64_avx2(QRgba64 *dst, const QRgba64 *src, i
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_Source_rgbafp_avx2(QRgba32F *dst, const QRgba32F *src, int length, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_Source_rgbafp_avx2(QRgbaFloat32 *dst, const QRgbaFloat32 *src, int length, uint const_alpha)
|
||||
{
|
||||
Q_ASSERT(const_alpha < 256); // const_alpha is in [0-255]
|
||||
if (const_alpha == 255) {
|
||||
::memcpy(dst, src, length * sizeof(QRgba32F));
|
||||
::memcpy(dst, src, length * sizeof(QRgbaFloat32));
|
||||
} else {
|
||||
const float ca = const_alpha / 255.f;
|
||||
const float cia = 1.0f - ca;
|
||||
|
|
@ -656,7 +656,7 @@ void QT_FASTCALL comp_func_solid_SourceOver_rgb64_avx2(QRgba64 *destPixels, int
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
void QT_FASTCALL comp_func_solid_Source_rgbafp_avx2(QRgba32F *dst, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_Source_rgbafp_avx2(QRgbaFloat32 *dst, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
Q_ASSERT(const_alpha < 256); // const_alpha is in [0-255]
|
||||
if (const_alpha == 255) {
|
||||
|
|
@ -686,7 +686,7 @@ void QT_FASTCALL comp_func_solid_Source_rgbafp_avx2(QRgba32F *dst, int length, Q
|
|||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL comp_func_solid_SourceOver_rgbafp_avx2(QRgba32F *dst, int length, QRgba32F color, uint const_alpha)
|
||||
void QT_FASTCALL comp_func_solid_SourceOver_rgbafp_avx2(QRgbaFloat32 *dst, int length, QRgbaFloat32 color, uint const_alpha)
|
||||
{
|
||||
Q_ASSERT(const_alpha < 256); // const_alpha is in [0-255]
|
||||
if (const_alpha == 255 && color.a >= 1.0f) {
|
||||
|
|
@ -1573,7 +1573,7 @@ void QT_FASTCALL storeRGBA16FFromARGB32PM_avx2(uchar *dest, const uint *src, int
|
|||
}
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
const QRgba32F *QT_FASTCALL fetchRGBA16FToRGBA32F_avx2(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
const QRgbaFloat32 *QT_FASTCALL fetchRGBA16FToRGBA32F_avx2(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const quint64 *s = reinterpret_cast<const quint64 *>(src) + index;
|
||||
|
|
@ -1595,7 +1595,7 @@ const QRgba32F *QT_FASTCALL fetchRGBA16FToRGBA32F_avx2(QRgba32F *buffer, const u
|
|||
return buffer;
|
||||
}
|
||||
|
||||
void QT_FASTCALL storeRGBX16FFromRGBA32F_avx2(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
void QT_FASTCALL storeRGBX16FFromRGBA32F_avx2(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
quint64 *d = reinterpret_cast<quint64 *>(dest) + index;
|
||||
|
|
@ -1619,7 +1619,7 @@ void QT_FASTCALL storeRGBX16FFromRGBA32F_avx2(uchar *dest, const QRgba32F *src,
|
|||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL storeRGBA16FFromRGBA32F_avx2(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
void QT_FASTCALL storeRGBA16FFromRGBA32F_avx2(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
quint64 *d = reinterpret_cast<quint64 *>(dest) + index;
|
||||
|
|
|
|||
|
|
@ -108,8 +108,8 @@ class QRasterBuffer;
|
|||
class QClipData;
|
||||
class QRasterPaintEngineState;
|
||||
|
||||
template<typename F> class QRgbaF;
|
||||
typedef QRgbaF<float> QRgba32F;
|
||||
template<typename F> class QRgbaFloat;
|
||||
typedef QRgbaFloat<float> QRgbaFloat32;
|
||||
|
||||
typedef QT_FT_SpanFunc ProcessSpans;
|
||||
typedef void (*BitmapBlitFunc)(QRasterBuffer *rasterBuffer,
|
||||
|
|
@ -197,10 +197,10 @@ extern void qt_memfill16(quint16 *dest, quint16 value, qsizetype count);
|
|||
|
||||
typedef void (QT_FASTCALL *CompositionFunction)(uint *Q_DECL_RESTRICT dest, const uint *Q_DECL_RESTRICT src, int length, uint const_alpha);
|
||||
typedef void (QT_FASTCALL *CompositionFunction64)(QRgba64 *Q_DECL_RESTRICT dest, const QRgba64 *Q_DECL_RESTRICT src, int length, uint const_alpha);
|
||||
typedef void (QT_FASTCALL *CompositionFunctionFP)(QRgba32F *Q_DECL_RESTRICT dest, const QRgba32F *Q_DECL_RESTRICT src, int length, uint const_alpha);
|
||||
typedef void (QT_FASTCALL *CompositionFunctionFP)(QRgbaFloat32 *Q_DECL_RESTRICT dest, const QRgbaFloat32 *Q_DECL_RESTRICT src, int length, uint const_alpha);
|
||||
typedef void (QT_FASTCALL *CompositionFunctionSolid)(uint *dest, int length, uint color, uint const_alpha);
|
||||
typedef void (QT_FASTCALL *CompositionFunctionSolid64)(QRgba64 *dest, int length, QRgba64 color, uint const_alpha);
|
||||
typedef void (QT_FASTCALL *CompositionFunctionSolidFP)(QRgba32F *dest, int length, QRgba32F color, uint const_alpha);
|
||||
typedef void (QT_FASTCALL *CompositionFunctionSolidFP)(QRgbaFloat32 *dest, int length, QRgbaFloat32 color, uint const_alpha);
|
||||
|
||||
struct LinearGradientValues
|
||||
{
|
||||
|
|
@ -224,13 +224,13 @@ struct RadialGradientValues
|
|||
struct Operator;
|
||||
typedef uint* (QT_FASTCALL *DestFetchProc)(uint *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length);
|
||||
typedef QRgba64* (QT_FASTCALL *DestFetchProc64)(QRgba64 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length);
|
||||
typedef QRgba32F* (QT_FASTCALL *DestFetchProcFP)(QRgba32F *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length);
|
||||
typedef QRgbaFloat32* (QT_FASTCALL *DestFetchProcFP)(QRgbaFloat32 *buffer, QRasterBuffer *rasterBuffer, int x, int y, int length);
|
||||
typedef void (QT_FASTCALL *DestStoreProc)(QRasterBuffer *rasterBuffer, int x, int y, const uint *buffer, int length);
|
||||
typedef void (QT_FASTCALL *DestStoreProc64)(QRasterBuffer *rasterBuffer, int x, int y, const QRgba64 *buffer, int length);
|
||||
typedef void (QT_FASTCALL *DestStoreProcFP)(QRasterBuffer *rasterBuffer, int x, int y, const QRgba32F *buffer, int length);
|
||||
typedef void (QT_FASTCALL *DestStoreProcFP)(QRasterBuffer *rasterBuffer, int x, int y, const QRgbaFloat32 *buffer, int length);
|
||||
typedef const uint* (QT_FASTCALL *SourceFetchProc)(uint *buffer, const Operator *o, const QSpanData *data, int y, int x, int length);
|
||||
typedef const QRgba64* (QT_FASTCALL *SourceFetchProc64)(QRgba64 *buffer, const Operator *o, const QSpanData *data, int y, int x, int length);
|
||||
typedef const QRgba32F* (QT_FASTCALL *SourceFetchProcFP)(QRgba32F *buffer, const Operator *o, const QSpanData *data, int y, int x, int length);
|
||||
typedef const QRgbaFloat32* (QT_FASTCALL *SourceFetchProcFP)(QRgbaFloat32 *buffer, const Operator *o, const QSpanData *data, int y, int x, int length);
|
||||
|
||||
struct Operator
|
||||
{
|
||||
|
|
@ -860,16 +860,16 @@ static inline QRgba64 interpolate_4_pixels_rgb64(const QRgba64 t[], const QRgba6
|
|||
#endif // __SSE2__
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static inline QRgba32F multiplyAlpha_rgba32f(QRgba32F c, float a)
|
||||
static inline QRgbaFloat32 multiplyAlpha_rgba32f(QRgbaFloat32 c, float a)
|
||||
{
|
||||
return QRgba32F { c.r * a, c.g * a, c.b * a, c.a * a };
|
||||
return QRgbaFloat32 { c.r * a, c.g * a, c.b * a, c.a * a };
|
||||
}
|
||||
|
||||
static inline QRgba32F interpolate_rgba32f(QRgba32F x, float alpha1, QRgba32F y, float alpha2)
|
||||
static inline QRgbaFloat32 interpolate_rgba32f(QRgbaFloat32 x, float alpha1, QRgbaFloat32 y, float alpha2)
|
||||
{
|
||||
x = multiplyAlpha_rgba32f(x, alpha1);
|
||||
y = multiplyAlpha_rgba32f(y, alpha2);
|
||||
return QRgba32F { x.r + y.r, x.g + y.g, x.b + y.b, x.a + y.a };
|
||||
return QRgbaFloat32 { x.r + y.r, x.g + y.g, x.b + y.b, x.a + y.a };
|
||||
}
|
||||
#ifdef __SSE2__
|
||||
static inline __m128 Q_DECL_VECTORCALL interpolate_rgba32f(__m128 x, __m128 alpha1, __m128 y, __m128 alpha2)
|
||||
|
|
@ -878,7 +878,7 @@ static inline __m128 Q_DECL_VECTORCALL interpolate_rgba32f(__m128 x, __m128 alph
|
|||
}
|
||||
#endif
|
||||
|
||||
static inline QRgba32F interpolate_4_pixels_rgba32f(const QRgba32F t[], const QRgba32F b[], uint distx, uint disty)
|
||||
static inline QRgbaFloat32 interpolate_4_pixels_rgba32f(const QRgbaFloat32 t[], const QRgbaFloat32 b[], uint distx, uint disty)
|
||||
{
|
||||
constexpr float f = 1.0f / 65536.0f;
|
||||
const float dx = distx * f;
|
||||
|
|
@ -898,12 +898,12 @@ static inline QRgba32F interpolate_4_pixels_rgba32f(const QRgba32F t[], const QR
|
|||
const __m128 vdy = _mm_set1_ps(dy);
|
||||
const __m128 vidy = _mm_set1_ps(idy);
|
||||
vt = interpolate_rgba32f(vt, vidy, vb, vdy);
|
||||
QRgba32F res;
|
||||
QRgbaFloat32 res;
|
||||
_mm_store_ps((float*)&res, vt);
|
||||
return res;
|
||||
#else
|
||||
QRgba32F xtop = interpolate_rgba32f(t[0], idx, t[1], dx);
|
||||
QRgba32F xbot = interpolate_rgba32f(b[0], idx, b[1], dx);
|
||||
QRgbaFloat32 xtop = interpolate_rgba32f(t[0], idx, t[1], dx);
|
||||
QRgbaFloat32 xbot = interpolate_rgba32f(b[0], idx, b[1], dx);
|
||||
xtop = interpolate_rgba32f(xtop, idy, xbot, dy);
|
||||
return xtop;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -552,10 +552,10 @@ void QT_FASTCALL storeRGBx64FromRGBA64PM_sse4(uchar *dest, const QRgba64 *src, i
|
|||
}
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
const QRgba32F *QT_FASTCALL fetchRGBA32FToRGBA32F_sse4(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
const QRgbaFloat32 *QT_FASTCALL fetchRGBA32FToRGBA32F_sse4(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba32F *s = reinterpret_cast<const QRgba32F *>(src) + index;
|
||||
const QRgbaFloat32 *s = reinterpret_cast<const QRgbaFloat32 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
__m128 vsf = _mm_load_ps(reinterpret_cast<const float *>(s + i));
|
||||
__m128 vsa = _mm_shuffle_ps(vsf, vsf, _MM_SHUFFLE(3, 3, 3, 3));
|
||||
|
|
@ -566,10 +566,10 @@ const QRgba32F *QT_FASTCALL fetchRGBA32FToRGBA32F_sse4(QRgba32F *buffer, const u
|
|||
return buffer;
|
||||
}
|
||||
|
||||
void QT_FASTCALL storeRGBX32FFromRGBA32F_sse4(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
void QT_FASTCALL storeRGBX32FFromRGBA32F_sse4(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
const __m128 zero = _mm_set_ps(1.0f, 0.0f, 0.0f, 0.0f);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
__m128 vsf = _mm_load_ps(reinterpret_cast<const float *>(src + i));
|
||||
|
|
@ -589,10 +589,10 @@ void QT_FASTCALL storeRGBX32FFromRGBA32F_sse4(uchar *dest, const QRgba32F *src,
|
|||
}
|
||||
}
|
||||
|
||||
void QT_FASTCALL storeRGBA32FFromRGBA32F_sse4(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
void QT_FASTCALL storeRGBA32FFromRGBA32F_sse4(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
const __m128 zero = _mm_set1_ps(0.0f);
|
||||
for (int i = 0; i < count; ++i) {
|
||||
__m128 vsf = _mm_load_ps(reinterpret_cast<const float *>(src + i));
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
#include "qimage.h"
|
||||
#include "qcolor.h"
|
||||
#include "qrgba64_p.h"
|
||||
#include "qrgbaf.h"
|
||||
#include "qrgbafloat.h"
|
||||
|
||||
#if QT_CONFIG(thread) && !defined(Q_OS_WASM)
|
||||
#include "qsemaphore.h"
|
||||
|
|
@ -792,31 +792,31 @@ static void qt_qimageScaleRgba64_down_xy(QImageScaleInfo *isi, QRgba64 *dest,
|
|||
#endif
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static void qt_qimageScaleRgbaFP_up_x_down_y(QImageScaleInfo *isi, QRgba32F *dest,
|
||||
static void qt_qimageScaleRgbaFP_up_x_down_y(QImageScaleInfo *isi, QRgbaFloat32 *dest,
|
||||
int dw, int dh, int dow, int sow);
|
||||
|
||||
static void qt_qimageScaleRgbaFP_down_x_up_y(QImageScaleInfo *isi, QRgba32F *dest,
|
||||
static void qt_qimageScaleRgbaFP_down_x_up_y(QImageScaleInfo *isi, QRgbaFloat32 *dest,
|
||||
int dw, int dh, int dow, int sow);
|
||||
|
||||
static void qt_qimageScaleRgbaFP_down_xy(QImageScaleInfo *isi, QRgba32F *dest,
|
||||
static void qt_qimageScaleRgbaFP_down_xy(QImageScaleInfo *isi, QRgbaFloat32 *dest,
|
||||
int dw, int dh, int dow, int sow);
|
||||
|
||||
static void qt_qimageScaleRgbaFP_up_xy(QImageScaleInfo *isi, QRgba32F *dest,
|
||||
static void qt_qimageScaleRgbaFP_up_xy(QImageScaleInfo *isi, QRgbaFloat32 *dest,
|
||||
int dw, int dh, int dow, int sow)
|
||||
{
|
||||
const QRgba32F **ypoints = (const QRgba32F **)isi->ypoints;
|
||||
const QRgbaFloat32 **ypoints = (const QRgbaFloat32 **)isi->ypoints;
|
||||
int *xpoints = isi->xpoints;
|
||||
int *xapoints = isi->xapoints;
|
||||
int *yapoints = isi->yapoints;
|
||||
|
||||
auto scaleSection = [&] (int yStart, int yEnd) {
|
||||
for (int y = yStart; y < yEnd; ++y) {
|
||||
const QRgba32F *sptr = ypoints[y];
|
||||
QRgba32F *dptr = dest + (y * dow);
|
||||
const QRgbaFloat32 *sptr = ypoints[y];
|
||||
QRgbaFloat32 *dptr = dest + (y * dow);
|
||||
const int yap = yapoints[y];
|
||||
if (yap > 0) {
|
||||
for (int x = 0; x < dw; x++) {
|
||||
const QRgba32F *pix = sptr + xpoints[x];
|
||||
const QRgbaFloat32 *pix = sptr + xpoints[x];
|
||||
const int xap = xapoints[x];
|
||||
if (xap > 0)
|
||||
*dptr = interpolate_4_pixels_rgba32f(pix, pix + sow, xap * 256, yap * 256);
|
||||
|
|
@ -826,7 +826,7 @@ static void qt_qimageScaleRgbaFP_up_xy(QImageScaleInfo *isi, QRgba32F *dest,
|
|||
}
|
||||
} else {
|
||||
for (int x = 0; x < dw; x++) {
|
||||
const QRgba32F *pix = sptr + xpoints[x];
|
||||
const QRgbaFloat32 *pix = sptr + xpoints[x];
|
||||
const int xap = xapoints[x];
|
||||
if (xap > 0)
|
||||
*dptr = interpolate_rgba32f(pix[0], 256 - xap, pix[1], xap);
|
||||
|
|
@ -840,7 +840,7 @@ static void qt_qimageScaleRgbaFP_up_xy(QImageScaleInfo *isi, QRgba32F *dest,
|
|||
multithread_pixels_function(isi, dh, scaleSection);
|
||||
}
|
||||
|
||||
void qt_qimageScaleRgbaFP(QImageScaleInfo *isi, QRgba32F *dest,
|
||||
void qt_qimageScaleRgbaFP(QImageScaleInfo *isi, QRgbaFloat32 *dest,
|
||||
int dw, int dh, int dow, int sow)
|
||||
{
|
||||
if (isi->xup_yup == 3)
|
||||
|
|
@ -853,7 +853,7 @@ void qt_qimageScaleRgbaFP(QImageScaleInfo *isi, QRgba32F *dest,
|
|||
qt_qimageScaleRgbaFP_down_xy(isi, dest, dw, dh, dow, sow);
|
||||
}
|
||||
|
||||
inline static void qt_qimageScaleRgbaFP_helper(const QRgba32F *pix, int xyap, int Cxy, int step, float &r, float &g, float &b, float &a)
|
||||
inline static void qt_qimageScaleRgbaFP_helper(const QRgbaFloat32 *pix, int xyap, int Cxy, int step, float &r, float &g, float &b, float &a)
|
||||
{
|
||||
constexpr float f = (1.0f / float(1<<14));
|
||||
const float xyapf = xyap * f;
|
||||
|
|
@ -878,10 +878,10 @@ inline static void qt_qimageScaleRgbaFP_helper(const QRgba32F *pix, int xyap, in
|
|||
a += pix->alpha() * jf;
|
||||
}
|
||||
|
||||
static void qt_qimageScaleRgbaFP_up_x_down_y(QImageScaleInfo *isi, QRgba32F *dest,
|
||||
static void qt_qimageScaleRgbaFP_up_x_down_y(QImageScaleInfo *isi, QRgbaFloat32 *dest,
|
||||
int dw, int dh, int dow, int sow)
|
||||
{
|
||||
const QRgba32F **ypoints = (const QRgba32F **)isi->ypoints;
|
||||
const QRgbaFloat32 **ypoints = (const QRgbaFloat32 **)isi->ypoints;
|
||||
int *xpoints = isi->xpoints;
|
||||
int *xapoints = isi->xapoints;
|
||||
int *yapoints = isi->yapoints;
|
||||
|
|
@ -891,9 +891,9 @@ static void qt_qimageScaleRgbaFP_up_x_down_y(QImageScaleInfo *isi, QRgba32F *des
|
|||
int Cy = (yapoints[y]) >> 16;
|
||||
int yap = (yapoints[y]) & 0xffff;
|
||||
|
||||
QRgba32F *dptr = dest + (y * dow);
|
||||
QRgbaFloat32 *dptr = dest + (y * dow);
|
||||
for (int x = 0; x < dw; x++) {
|
||||
const QRgba32F *sptr = ypoints[y] + xpoints[x];
|
||||
const QRgbaFloat32 *sptr = ypoints[y] + xpoints[x];
|
||||
float r, g, b, a;
|
||||
qt_qimageScaleRgbaFP_helper(sptr, yap, Cy, sow, r, g, b, a);
|
||||
|
||||
|
|
@ -908,29 +908,29 @@ static void qt_qimageScaleRgbaFP_up_x_down_y(QImageScaleInfo *isi, QRgba32F *des
|
|||
b = (b * (1.0f - xapf) + (bb * xapf));
|
||||
a = (a * (1.0f - xapf) + (aa * xapf));
|
||||
}
|
||||
*dptr++ = QRgba32F{r, g, b, a};
|
||||
*dptr++ = QRgbaFloat32{r, g, b, a};
|
||||
}
|
||||
}
|
||||
};
|
||||
multithread_pixels_function(isi, dh, scaleSection);
|
||||
}
|
||||
|
||||
static void qt_qimageScaleRgbaFP_down_x_up_y(QImageScaleInfo *isi, QRgba32F *dest,
|
||||
static void qt_qimageScaleRgbaFP_down_x_up_y(QImageScaleInfo *isi, QRgbaFloat32 *dest,
|
||||
int dw, int dh, int dow, int sow)
|
||||
{
|
||||
const QRgba32F **ypoints = (const QRgba32F **)isi->ypoints;
|
||||
const QRgbaFloat32 **ypoints = (const QRgbaFloat32 **)isi->ypoints;
|
||||
int *xpoints = isi->xpoints;
|
||||
int *xapoints = isi->xapoints;
|
||||
int *yapoints = isi->yapoints;
|
||||
|
||||
auto scaleSection = [&] (int yStart, int yEnd) {
|
||||
for (int y = yStart; y < yEnd; ++y) {
|
||||
QRgba32F *dptr = dest + (y * dow);
|
||||
QRgbaFloat32 *dptr = dest + (y * dow);
|
||||
for (int x = 0; x < dw; x++) {
|
||||
int Cx = xapoints[x] >> 16;
|
||||
int xap = xapoints[x] & 0xffff;
|
||||
|
||||
const QRgba32F *sptr = ypoints[y] + xpoints[x];
|
||||
const QRgbaFloat32 *sptr = ypoints[y] + xpoints[x];
|
||||
float r, g, b, a;
|
||||
qt_qimageScaleRgbaFP_helper(sptr, xap, Cx, 1, r, g, b, a);
|
||||
|
||||
|
|
@ -945,17 +945,17 @@ static void qt_qimageScaleRgbaFP_down_x_up_y(QImageScaleInfo *isi, QRgba32F *des
|
|||
b = (b * (1.0f - yapf) + (bb * yapf));
|
||||
a = (a * (1.0f - yapf) + (aa * yapf));
|
||||
}
|
||||
*dptr++ = QRgba32F{r, g, b, a};
|
||||
*dptr++ = QRgbaFloat32{r, g, b, a};
|
||||
}
|
||||
}
|
||||
};
|
||||
multithread_pixels_function(isi, dh, scaleSection);
|
||||
}
|
||||
|
||||
static void qt_qimageScaleRgbaFP_down_xy(QImageScaleInfo *isi, QRgba32F *dest,
|
||||
static void qt_qimageScaleRgbaFP_down_xy(QImageScaleInfo *isi, QRgbaFloat32 *dest,
|
||||
int dw, int dh, int dow, int sow)
|
||||
{
|
||||
const QRgba32F **ypoints = (const QRgba32F **)isi->ypoints;
|
||||
const QRgbaFloat32 **ypoints = (const QRgbaFloat32 **)isi->ypoints;
|
||||
int *xpoints = isi->xpoints;
|
||||
int *xapoints = isi->xapoints;
|
||||
int *yapoints = isi->yapoints;
|
||||
|
|
@ -966,12 +966,12 @@ static void qt_qimageScaleRgbaFP_down_xy(QImageScaleInfo *isi, QRgba32F *dest,
|
|||
int Cy = (yapoints[y]) >> 16;
|
||||
int yap = (yapoints[y]) & 0xffff;
|
||||
|
||||
QRgba32F *dptr = dest + (y * dow);
|
||||
QRgbaFloat32 *dptr = dest + (y * dow);
|
||||
for (int x = 0; x < dw; x++) {
|
||||
int Cx = xapoints[x] >> 16;
|
||||
int xap = xapoints[x] & 0xffff;
|
||||
|
||||
const QRgba32F *sptr = ypoints[y] + xpoints[x];
|
||||
const QRgbaFloat32 *sptr = ypoints[y] + xpoints[x];
|
||||
float rx, gx, bx, ax;
|
||||
qt_qimageScaleRgbaFP_helper(sptr, xap, Cx, 1, rx, gx, bx, ax);
|
||||
|
||||
|
|
@ -998,7 +998,7 @@ static void qt_qimageScaleRgbaFP_down_xy(QImageScaleInfo *isi, QRgba32F *dest,
|
|||
b += bx * jf;
|
||||
a += ax * jf;
|
||||
|
||||
*dptr++ = QRgba32F{r, g, b, a};
|
||||
*dptr++ = QRgbaFloat32{r, g, b, a};
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -1233,7 +1233,7 @@ QImage qSmoothScaleImage(const QImage &src, int dw, int dh)
|
|||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
if (qt_fpColorPrecision(src.format()))
|
||||
qt_qimageScaleRgbaFP(scaleinfo, (QRgba32F *)buffer.scanLine(0),
|
||||
qt_qimageScaleRgbaFP(scaleinfo, (QRgbaFloat32 *)buffer.scanLine(0),
|
||||
dw, dh, dw, src.bytesPerLine() / 16);
|
||||
else
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ Q_GUI_EXPORT void qt_memrotate270(const type *src, int w, int h, int sstride, \
|
|||
qt_memrotate270_tiled_unpacked(src, w, h, sstride, dest, dstride); \
|
||||
}
|
||||
|
||||
QT_IMPL_SIMPLE_MEMROTATE(QRgba32F)
|
||||
QT_IMPL_SIMPLE_MEMROTATE(QRgbaFloat32)
|
||||
QT_IMPL_SIMPLE_MEMROTATE(quint64)
|
||||
QT_IMPL_SIMPLE_MEMROTATE(quint32)
|
||||
QT_IMPL_SIMPLE_MEMROTATE(quint24)
|
||||
|
|
@ -381,17 +381,17 @@ void qt_memrotate270_64(const uchar *srcPixels, int w, int h, int sbpl, uchar *d
|
|||
|
||||
void qt_memrotate90_128(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
|
||||
{
|
||||
qt_memrotate90((const QRgba32F *)srcPixels, w, h, sbpl, (QRgba32F *)destPixels, dbpl);
|
||||
qt_memrotate90((const QRgbaFloat32 *)srcPixels, w, h, sbpl, (QRgbaFloat32 *)destPixels, dbpl);
|
||||
}
|
||||
|
||||
void qt_memrotate180_128(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
|
||||
{
|
||||
qt_memrotate180((const QRgba32F *)srcPixels, w, h, sbpl, (QRgba32F *)destPixels, dbpl);
|
||||
qt_memrotate180((const QRgbaFloat32 *)srcPixels, w, h, sbpl, (QRgbaFloat32 *)destPixels, dbpl);
|
||||
}
|
||||
|
||||
void qt_memrotate270_128(const uchar *srcPixels, int w, int h, int sbpl, uchar *destPixels, int dbpl)
|
||||
{
|
||||
qt_memrotate270((const QRgba32F *)srcPixels, w, h, sbpl, (QRgba32F *)destPixels, dbpl);
|
||||
qt_memrotate270((const QRgbaFloat32 *)srcPixels, w, h, sbpl, (QRgbaFloat32 *)destPixels, dbpl);
|
||||
}
|
||||
|
||||
MemRotateFunc qMemRotateFunctions[QPixelLayout::BPPCount][3] =
|
||||
|
|
|
|||
|
|
@ -302,7 +302,7 @@ template <>
|
|||
inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP16FPx4>(const uchar *src, int index)
|
||||
{
|
||||
// We have to do the conversion in fetch to fit into a 32bit uint
|
||||
QRgba16F c = reinterpret_cast<const QRgba16F *>(src)[index];
|
||||
QRgbaFloat16 c = reinterpret_cast<const QRgbaFloat16 *>(src)[index];
|
||||
return c.toArgb32();
|
||||
}
|
||||
|
||||
|
|
@ -311,7 +311,7 @@ template <>
|
|||
inline uint QT_FASTCALL fetchPixel<QPixelLayout::BPP32FPx4>(const uchar *src, int index)
|
||||
{
|
||||
// We have to do the conversion in fetch to fit into a 32bit uint
|
||||
QRgba32F c = reinterpret_cast<const QRgba32F *>(src)[index];
|
||||
QRgbaFloat32 c = reinterpret_cast<const QRgbaFloat32 *>(src)[index];
|
||||
return c.toArgb32();
|
||||
}
|
||||
|
||||
|
|
@ -395,13 +395,13 @@ static const QRgba64 *QT_FASTCALL fetchRGBToRGB64(QRgba64 *buffer, const uchar *
|
|||
}
|
||||
|
||||
template<QImage::Format Format>
|
||||
static Q_ALWAYS_INLINE QRgba32F convertPixelToRGB32F(uint s)
|
||||
static Q_ALWAYS_INLINE QRgbaFloat32 convertPixelToRGB32F(uint s)
|
||||
{
|
||||
return QRgba32F::fromArgb32(convertPixelToRGB32<Format>(s));
|
||||
return QRgbaFloat32::fromArgb32(convertPixelToRGB32<Format>(s));
|
||||
}
|
||||
|
||||
template<QImage::Format Format>
|
||||
static const QRgba32F *QT_FASTCALL fetchRGBToRGB32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGBToRGB32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
|
|
@ -502,13 +502,13 @@ static const QRgba64 *QT_FASTCALL fetchARGBPMToRGBA64PM(QRgba64 *buffer, const u
|
|||
}
|
||||
|
||||
template<QImage::Format Format>
|
||||
static Q_ALWAYS_INLINE QRgba32F convertPixelToRGBA32F(uint s)
|
||||
static Q_ALWAYS_INLINE QRgbaFloat32 convertPixelToRGBA32F(uint s)
|
||||
{
|
||||
return QRgba32F::fromArgb32(convertPixelToARGB32PM<Format>(s));
|
||||
return QRgbaFloat32::fromArgb32(convertPixelToARGB32PM<Format>(s));
|
||||
}
|
||||
|
||||
template<QImage::Format Format>
|
||||
static const QRgba32F *QT_FASTCALL fetchARGBPMToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchARGBPMToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
constexpr QPixelLayout::BPP bpp = bitsPerPixel<Format>();
|
||||
|
|
@ -518,7 +518,7 @@ static const QRgba32F *QT_FASTCALL fetchARGBPMToRGBA32F(QRgba32F *buffer, const
|
|||
}
|
||||
|
||||
template<QImage::Format Format>
|
||||
static const QRgba32F *QT_FASTCALL fetchARGBToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchARGBToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
constexpr QPixelLayout::BPP bpp = bitsPerPixel<Format>();
|
||||
|
|
@ -809,12 +809,12 @@ static const QRgba64 *QT_FASTCALL fetchIndexedToRGBA64PM(QRgba64 *buffer, const
|
|||
}
|
||||
|
||||
template<QPixelLayout::BPP BPP>
|
||||
static const QRgba32F *QT_FASTCALL fetchIndexedToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchIndexedToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *clut, QDitherInfo *)
|
||||
{
|
||||
for (int i = 0; i < count; ++i) {
|
||||
const uint s = fetchPixel<BPP>(src, index + i);
|
||||
buffer[i] = QRgba32F::fromArgb32(clut->at(s)).premultiplied();
|
||||
buffer[i] = QRgbaFloat32::fromArgb32(clut->at(s)).premultiplied();
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
|
@ -1389,30 +1389,30 @@ static const QRgba64 *QT_FASTCALL fetchA2RGB30PMToRGBA64PM(QRgba64 *buffer, cons
|
|||
return convertA2RGB30PMToRGBA64PM<PixelOrder>(buffer, reinterpret_cast<const uint *>(src) + index, count, nullptr, nullptr);
|
||||
}
|
||||
|
||||
template<enum QtPixelOrder> inline QRgba32F qConvertA2rgb30ToRgbaFP(uint rgb);
|
||||
template<enum QtPixelOrder> inline QRgbaFloat32 qConvertA2rgb30ToRgbaFP(uint rgb);
|
||||
|
||||
template<>
|
||||
inline QRgba32F qConvertA2rgb30ToRgbaFP<PixelOrderBGR>(uint rgb)
|
||||
inline QRgbaFloat32 qConvertA2rgb30ToRgbaFP<PixelOrderBGR>(uint rgb)
|
||||
{
|
||||
float alpha = (rgb >> 30) * (1.f/3.f);
|
||||
float blue = ((rgb >> 20) & 0x3ff) * (1.f/1023.f);
|
||||
float green = ((rgb >> 10) & 0x3ff) * (1.f/1023.f);
|
||||
float red = (rgb & 0x3ff) * (1.f/1023.f);
|
||||
return QRgba32F{ red, green, blue, alpha };
|
||||
return QRgbaFloat32{ red, green, blue, alpha };
|
||||
}
|
||||
|
||||
template<>
|
||||
inline QRgba32F qConvertA2rgb30ToRgbaFP<PixelOrderRGB>(uint rgb)
|
||||
inline QRgbaFloat32 qConvertA2rgb30ToRgbaFP<PixelOrderRGB>(uint rgb)
|
||||
{
|
||||
float alpha = (rgb >> 30) * (1.f/3.f);
|
||||
float red = ((rgb >> 20) & 0x3ff) * (1.f/1023.f);
|
||||
float green = ((rgb >> 10) & 0x3ff) * (1.f/1023.f);
|
||||
float blue = (rgb & 0x3ff) * (1.f/1023.f);
|
||||
return QRgba32F{ red, green, blue, alpha };
|
||||
return QRgbaFloat32{ red, green, blue, alpha };
|
||||
}
|
||||
|
||||
template<QtPixelOrder PixelOrder>
|
||||
static const QRgba32F *QT_FASTCALL convertA2RGB30PMToRGBA32F(QRgba32F *buffer, const uint *src, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL convertA2RGB30PMToRGBA32F(QRgbaFloat32 *buffer, const uint *src, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
|
|
@ -1421,7 +1421,7 @@ static const QRgba32F *QT_FASTCALL convertA2RGB30PMToRGBA32F(QRgba32F *buffer, c
|
|||
}
|
||||
|
||||
template<QtPixelOrder PixelOrder>
|
||||
static const QRgba32F *QT_FASTCALL fetchRGB30ToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGB30ToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
return convertA2RGB30PMToRGBA32F<PixelOrder>(buffer, reinterpret_cast<const uint *>(src) + index, count, nullptr, nullptr);
|
||||
|
|
@ -1583,7 +1583,7 @@ static void QT_FASTCALL storeRGBA64FromARGB32(uchar *dest, const uint *src, int
|
|||
static const uint *QT_FASTCALL fetchRGB16FToRGB32(uint *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba16F *s = reinterpret_cast<const QRgba16F *>(src) + index;
|
||||
const QRgbaFloat16 *s = reinterpret_cast<const QRgbaFloat16 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = s[i].toArgb32();
|
||||
return buffer;
|
||||
|
|
@ -1592,15 +1592,15 @@ static const uint *QT_FASTCALL fetchRGB16FToRGB32(uint *buffer, const uchar *src
|
|||
static void QT_FASTCALL storeRGB16FFromRGB32(uchar *dest, const uint *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba16F *d = reinterpret_cast<QRgba16F *>(dest) + index;
|
||||
QRgbaFloat16 *d = reinterpret_cast<QRgbaFloat16 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = QRgba16F::fromArgb32(src[i]);
|
||||
d[i] = QRgbaFloat16::fromArgb32(src[i]);
|
||||
}
|
||||
|
||||
static const uint *QT_FASTCALL fetchRGBA16FToARGB32PM(uint *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba16F *s = reinterpret_cast<const QRgba16F *>(src) + index;
|
||||
const QRgbaFloat16 *s = reinterpret_cast<const QRgbaFloat16 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = s[i].premultiplied().toArgb32();
|
||||
return buffer;
|
||||
|
|
@ -1609,9 +1609,9 @@ static const uint *QT_FASTCALL fetchRGBA16FToARGB32PM(uint *buffer, const uchar
|
|||
static const QRgba64 *QT_FASTCALL fetchRGBA16FToRGBA64PM(QRgba64 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba16F *s = reinterpret_cast<const QRgba16F *>(src) + index;
|
||||
const QRgbaFloat16 *s = reinterpret_cast<const QRgbaFloat16 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba16F c = s[i].premultiplied();
|
||||
QRgbaFloat16 c = s[i].premultiplied();
|
||||
buffer[i] = QRgba64::fromRgba64(c.red16(), c.green16(), c.blue16(), c.alpha16());
|
||||
}
|
||||
return buffer;
|
||||
|
|
@ -1620,17 +1620,17 @@ static const QRgba64 *QT_FASTCALL fetchRGBA16FToRGBA64PM(QRgba64 *buffer, const
|
|||
static void QT_FASTCALL storeRGBA16FFromARGB32PM(uchar *dest, const uint *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba16F *d = reinterpret_cast<QRgba16F *>(dest) + index;
|
||||
QRgbaFloat16 *d = reinterpret_cast<QRgbaFloat16 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = QRgba16F::fromArgb32(src[i]).unpremultiplied();
|
||||
d[i] = QRgbaFloat16::fromArgb32(src[i]).unpremultiplied();
|
||||
}
|
||||
|
||||
static const QRgba64 *QT_FASTCALL fetchRGBA16FPMToRGBA64PM(QRgba64 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba16F *s = reinterpret_cast<const QRgba16F *>(src) + index;
|
||||
const QRgbaFloat16 *s = reinterpret_cast<const QRgbaFloat16 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba16F c = s[i];
|
||||
QRgbaFloat16 c = s[i];
|
||||
buffer[i] = QRgba64::fromRgba64(c.red16(), c.green16(), c.blue16(), c.alpha16());
|
||||
}
|
||||
return buffer;
|
||||
|
|
@ -1639,7 +1639,7 @@ static const QRgba64 *QT_FASTCALL fetchRGBA16FPMToRGBA64PM(QRgba64 *buffer, cons
|
|||
static const uint *QT_FASTCALL fetchRGB32FToRGB32(uint *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba32F *s = reinterpret_cast<const QRgba32F *>(src) + index;
|
||||
const QRgbaFloat32 *s = reinterpret_cast<const QRgbaFloat32 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = s[i].toArgb32();
|
||||
return buffer;
|
||||
|
|
@ -1648,15 +1648,15 @@ static const uint *QT_FASTCALL fetchRGB32FToRGB32(uint *buffer, const uchar *src
|
|||
static void QT_FASTCALL storeRGB32FFromRGB32(uchar *dest, const uint *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = QRgba32F::fromArgb32(src[i]);
|
||||
d[i] = QRgbaFloat32::fromArgb32(src[i]);
|
||||
}
|
||||
|
||||
static const uint *QT_FASTCALL fetchRGBA32FToARGB32PM(uint *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba32F *s = reinterpret_cast<const QRgba32F *>(src) + index;
|
||||
const QRgbaFloat32 *s = reinterpret_cast<const QRgbaFloat32 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = s[i].premultiplied().toArgb32();
|
||||
return buffer;
|
||||
|
|
@ -1665,9 +1665,9 @@ static const uint *QT_FASTCALL fetchRGBA32FToARGB32PM(uint *buffer, const uchar
|
|||
static const QRgba64 *QT_FASTCALL fetchRGBA32FToRGBA64PM(QRgba64 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba32F *s = reinterpret_cast<const QRgba32F *>(src) + index;
|
||||
const QRgbaFloat32 *s = reinterpret_cast<const QRgbaFloat32 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba32F c = s[i].premultiplied();
|
||||
QRgbaFloat32 c = s[i].premultiplied();
|
||||
buffer[i] = QRgba64::fromRgba64(c.red16(), c.green16(), c.blue16(), c.alpha16());
|
||||
}
|
||||
return buffer;
|
||||
|
|
@ -1676,17 +1676,17 @@ static const QRgba64 *QT_FASTCALL fetchRGBA32FToRGBA64PM(QRgba64 *buffer, const
|
|||
static void QT_FASTCALL storeRGBA32FFromARGB32PM(uchar *dest, const uint *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = QRgba32F::fromArgb32(src[i]).unpremultiplied();
|
||||
d[i] = QRgbaFloat32::fromArgb32(src[i]).unpremultiplied();
|
||||
}
|
||||
|
||||
static const QRgba64 *QT_FASTCALL fetchRGBA32FPMToRGBA64PM(QRgba64 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba32F *s = reinterpret_cast<const QRgba32F *>(src) + index;
|
||||
const QRgbaFloat32 *s = reinterpret_cast<const QRgbaFloat32 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba32F c = s[i];
|
||||
QRgbaFloat32 c = s[i];
|
||||
buffer[i] = QRgba64::fromRgba64(c.red16(), c.green16(), c.blue16(), c.alpha16());
|
||||
}
|
||||
return buffer;
|
||||
|
|
@ -1902,7 +1902,7 @@ static void QT_FASTCALL storeGray16FromRGBA64PM(uchar *dest, const QRgba64 *src,
|
|||
static void QT_FASTCALL storeRGBX16FFromRGBA64PM(uchar *dest, const QRgba64 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba16F *d = reinterpret_cast<QRgba16F *>(dest) + index;
|
||||
QRgbaFloat16 *d = reinterpret_cast<QRgbaFloat16 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
d[i] = qConvertRgb64ToRgbaF16(src[i]).unpremultiplied();
|
||||
d[i].setAlpha(1.0);
|
||||
|
|
@ -1912,7 +1912,7 @@ static void QT_FASTCALL storeRGBX16FFromRGBA64PM(uchar *dest, const QRgba64 *src
|
|||
static void QT_FASTCALL storeRGBA16FFromRGBA64PM(uchar *dest, const QRgba64 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba16F *d = reinterpret_cast<QRgba16F *>(dest) + index;
|
||||
QRgbaFloat16 *d = reinterpret_cast<QRgbaFloat16 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = qConvertRgb64ToRgbaF16(src[i]).unpremultiplied();
|
||||
}
|
||||
|
|
@ -1920,7 +1920,7 @@ static void QT_FASTCALL storeRGBA16FFromRGBA64PM(uchar *dest, const QRgba64 *src
|
|||
static void QT_FASTCALL storeRGBA16FPMFromRGBA64PM(uchar *dest, const QRgba64 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba16F *d = reinterpret_cast<QRgba16F *>(dest) + index;
|
||||
QRgbaFloat16 *d = reinterpret_cast<QRgbaFloat16 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = qConvertRgb64ToRgbaF16(src[i]);
|
||||
}
|
||||
|
|
@ -1928,7 +1928,7 @@ static void QT_FASTCALL storeRGBA16FPMFromRGBA64PM(uchar *dest, const QRgba64 *s
|
|||
static void QT_FASTCALL storeRGBX32FFromRGBA64PM(uchar *dest, const QRgba64 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
d[i] = qConvertRgb64ToRgbaF32(src[i]).unpremultiplied();
|
||||
d[i].setAlpha(1.0);
|
||||
|
|
@ -1938,7 +1938,7 @@ static void QT_FASTCALL storeRGBX32FFromRGBA64PM(uchar *dest, const QRgba64 *src
|
|||
static void QT_FASTCALL storeRGBA32FFromRGBA64PM(uchar *dest, const QRgba64 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = qConvertRgb64ToRgbaF32(src[i]).unpremultiplied();
|
||||
}
|
||||
|
|
@ -1946,7 +1946,7 @@ static void QT_FASTCALL storeRGBA32FFromRGBA64PM(uchar *dest, const QRgba64 *src
|
|||
static void QT_FASTCALL storeRGBA32FPMFromRGBA64PM(uchar *dest, const QRgba64 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = qConvertRgb64ToRgbaF32(src[i]);
|
||||
}
|
||||
|
|
@ -1991,14 +1991,14 @@ ConvertAndStorePixelsFunc64 qStoreFromRGBA64PM[QImage::NImageFormats] = {
|
|||
};
|
||||
|
||||
#if QT_CONFIG(raster_fp)
|
||||
static void QT_FASTCALL convertToRgbaF32(QRgba32F *dest, const uint *src, int length)
|
||||
static void QT_FASTCALL convertToRgbaF32(QRgbaFloat32 *dest, const uint *src, int length)
|
||||
{
|
||||
for (int i = 0; i < length; ++i)
|
||||
dest[i] = QRgba32F::fromArgb32(src[i]);
|
||||
dest[i] = QRgbaFloat32::fromArgb32(src[i]);
|
||||
}
|
||||
|
||||
template<QImage::Format format>
|
||||
static const QRgba32F * QT_FASTCALL convertGenericToRGBA32F(QRgba32F *buffer, const uint *src, int count,
|
||||
static const QRgbaFloat32 * QT_FASTCALL convertGenericToRGBA32F(QRgbaFloat32 *buffer, const uint *src, int count,
|
||||
const QList<QRgb> *clut, QDitherInfo *)
|
||||
{
|
||||
uint buffer32[BufferSize];
|
||||
|
|
@ -2008,38 +2008,38 @@ static const QRgba32F * QT_FASTCALL convertGenericToRGBA32F(QRgba32F *buffer, co
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba32F * QT_FASTCALL convertARGB32ToRGBA32F(QRgba32F *buffer, const uint *src, int count,
|
||||
static const QRgbaFloat32 * QT_FASTCALL convertARGB32ToRGBA32F(QRgbaFloat32 *buffer, const uint *src, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = QRgba32F::fromArgb32(src[i]).premultiplied();
|
||||
buffer[i] = QRgbaFloat32::fromArgb32(src[i]).premultiplied();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba32F * QT_FASTCALL convertRGBA8888ToRGBA32F(QRgba32F *buffer, const uint *src, int count,
|
||||
static const QRgbaFloat32 * QT_FASTCALL convertRGBA8888ToRGBA32F(QRgbaFloat32 *buffer, const uint *src, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = QRgba32F::fromArgb32(RGBA2ARGB(src[i])).premultiplied();
|
||||
buffer[i] = QRgbaFloat32::fromArgb32(RGBA2ARGB(src[i])).premultiplied();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
template<QtPixelOrder PixelOrder>
|
||||
static const QRgba32F * QT_FASTCALL convertRGB30ToRGBA32F(QRgba32F *buffer, const uint *src, int count,
|
||||
static const QRgbaFloat32 * QT_FASTCALL convertRGB30ToRGBA32F(QRgbaFloat32 *buffer, const uint *src, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba64 s = qConvertA2rgb30ToRgb64<PixelOrder>(src[i]);
|
||||
buffer[i] = QRgba32F::fromRgba64(s.red(), s.green(), s.blue(), s.alpha());
|
||||
buffer[i] = QRgbaFloat32::fromRgba64(s.red(), s.green(), s.blue(), s.alpha());
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
ConvertToFPFunc qConvertToRGBA32F[QImage::NImageFormats] = {
|
||||
nullptr,
|
||||
convertIndexedTo<QRgba32F>,
|
||||
convertIndexedTo<QRgba32F>,
|
||||
convertIndexedTo<QRgba32F>,
|
||||
convertIndexedTo<QRgbaFloat32>,
|
||||
convertIndexedTo<QRgbaFloat32>,
|
||||
convertIndexedTo<QRgbaFloat32>,
|
||||
convertGenericToRGBA32F<QImage::Format_RGB32>,
|
||||
convertARGB32ToRGBA32F,
|
||||
convertGenericToRGBA32F<QImage::Format_ARGB32_Premultiplied>,
|
||||
|
|
@ -2059,12 +2059,12 @@ ConvertToFPFunc qConvertToRGBA32F[QImage::NImageFormats] = {
|
|||
convertRGB30ToRGBA32F<PixelOrderBGR>,
|
||||
convertRGB30ToRGBA32F<PixelOrderRGB>,
|
||||
convertRGB30ToRGBA32F<PixelOrderRGB>,
|
||||
convertAlpha8To<QRgba32F>,
|
||||
convertGrayscale8To<QRgba32F>,
|
||||
convertAlpha8To<QRgbaFloat32>,
|
||||
convertGrayscale8To<QRgbaFloat32>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
convertGrayscale16To<QRgba32F>,
|
||||
convertGrayscale16To<QRgbaFloat32>,
|
||||
convertGenericToRGBA32F<QImage::Format_BGR888>,
|
||||
nullptr,
|
||||
nullptr,
|
||||
|
|
@ -2074,18 +2074,18 @@ ConvertToFPFunc qConvertToRGBA32F[QImage::NImageFormats] = {
|
|||
nullptr,
|
||||
};
|
||||
|
||||
static const QRgba32F *QT_FASTCALL fetchRGBX64ToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGBX64ToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba64 *s = reinterpret_cast<const QRgba64 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
QRgba64 c = s[i];
|
||||
buffer[i] = QRgba32F::fromRgba64(c.red(), c.green(), c.blue(), 65535);
|
||||
buffer[i] = QRgbaFloat32::fromRgba64(c.red(), c.green(), c.blue(), 65535);
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba32F *QT_FASTCALL fetchRGBA64ToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGBA64ToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba64 *s = reinterpret_cast<const QRgba64 *>(src) + index;
|
||||
|
|
@ -2094,7 +2094,7 @@ static const QRgba32F *QT_FASTCALL fetchRGBA64ToRGBA32F(QRgba32F *buffer, const
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba32F *QT_FASTCALL fetchRGBA64PMToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGBA64PMToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba64 *s = reinterpret_cast<const QRgba64 *>(src) + index;
|
||||
|
|
@ -2103,38 +2103,38 @@ static const QRgba32F *QT_FASTCALL fetchRGBA64PMToRGBA32F(QRgba32F *buffer, cons
|
|||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba32F *QT_FASTCALL fetchRGBA16FToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGBA16FToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba16F *s = reinterpret_cast<const QRgba16F *>(src) + index;
|
||||
const QRgbaFloat16 *s = reinterpret_cast<const QRgbaFloat16 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
auto c = s[i].premultiplied();
|
||||
buffer[i] = QRgba32F { c.r, c.g, c.b, c.a};
|
||||
buffer[i] = QRgbaFloat32 { c.r, c.g, c.b, c.a};
|
||||
}
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba32F *QT_FASTCALL fetchRGBA16F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGBA16F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba16F *s = reinterpret_cast<const QRgba16F *>(src) + index;
|
||||
const QRgbaFloat16 *s = reinterpret_cast<const QRgbaFloat16 *>(src) + index;
|
||||
qFloatFromFloat16((float *)buffer, (const qfloat16 *)s, count * 4);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba32F *QT_FASTCALL fetchRGBA32FToRGBA32F(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGBA32FToRGBA32F(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba32F *s = reinterpret_cast<const QRgba32F *>(src) + index;
|
||||
const QRgbaFloat32 *s = reinterpret_cast<const QRgbaFloat32 *>(src) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
buffer[i] = s[i].premultiplied();
|
||||
return buffer;
|
||||
}
|
||||
|
||||
static const QRgba32F *QT_FASTCALL fetchRGBA32F(QRgba32F *, const uchar *src, int index, int,
|
||||
static const QRgbaFloat32 *QT_FASTCALL fetchRGBA32F(QRgbaFloat32 *, const uchar *src, int index, int,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
const QRgba32F *s = reinterpret_cast<const QRgba32F *>(src) + index;
|
||||
const QRgbaFloat32 *s = reinterpret_cast<const QRgbaFloat32 *>(src) + index;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
@ -2162,12 +2162,12 @@ FetchAndConvertPixelsFuncFP qFetchToRGBA32F[QImage::NImageFormats] = {
|
|||
fetchRGB30ToRGBA32F<PixelOrderBGR>,
|
||||
fetchRGB30ToRGBA32F<PixelOrderRGB>,
|
||||
fetchRGB30ToRGBA32F<PixelOrderRGB>,
|
||||
fetchAlpha8To<QRgba32F>,
|
||||
fetchGrayscale8To<QRgba32F>,
|
||||
fetchAlpha8To<QRgbaFloat32>,
|
||||
fetchGrayscale8To<QRgbaFloat32>,
|
||||
fetchRGBX64ToRGBA32F,
|
||||
fetchRGBA64ToRGBA32F,
|
||||
fetchRGBA64PMToRGBA32F,
|
||||
fetchGrayscale16To<QRgba32F>,
|
||||
fetchGrayscale16To<QRgbaFloat32>,
|
||||
fetchRGBToRGB32F<QImage::Format_BGR888>,
|
||||
fetchRGBA16F,
|
||||
fetchRGBA16FToRGBA32F,
|
||||
|
|
@ -2177,14 +2177,14 @@ FetchAndConvertPixelsFuncFP qFetchToRGBA32F[QImage::NImageFormats] = {
|
|||
fetchRGBA32F,
|
||||
};
|
||||
|
||||
static void QT_FASTCALL convertFromRgba32f(uint *dest, const QRgba32F *src, int length)
|
||||
static void QT_FASTCALL convertFromRgba32f(uint *dest, const QRgbaFloat32 *src, int length)
|
||||
{
|
||||
for (int i = 0; i < length; ++i)
|
||||
dest[i] = src[i].toArgb32();
|
||||
}
|
||||
|
||||
template<QImage::Format format>
|
||||
static void QT_FASTCALL storeGenericFromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeGenericFromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *clut, QDitherInfo *dither)
|
||||
{
|
||||
uint buffer[BufferSize];
|
||||
|
|
@ -2192,7 +2192,7 @@ static void QT_FASTCALL storeGenericFromRGBA32F(uchar *dest, const QRgba32F *src
|
|||
qPixelLayouts[format].storeFromARGB32PM(dest, buffer, index, count, clut, dither);
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeARGB32FromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeARGB32FromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
uint *d = (uint*)dest + index;
|
||||
|
|
@ -2200,7 +2200,7 @@ static void QT_FASTCALL storeARGB32FromRGBA32F(uchar *dest, const QRgba32F *src,
|
|||
d[i] = src[i].unpremultiplied().toArgb32();
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBA8888FromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBA8888FromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
uint *d = (uint*)dest + index;
|
||||
|
|
@ -2209,7 +2209,7 @@ static void QT_FASTCALL storeRGBA8888FromRGBA32F(uchar *dest, const QRgba32F *sr
|
|||
}
|
||||
|
||||
template<QtPixelOrder PixelOrder>
|
||||
static void QT_FASTCALL storeRGB30FromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGB30FromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
uint *d = (uint*)dest + index;
|
||||
|
|
@ -2219,7 +2219,7 @@ static void QT_FASTCALL storeRGB30FromRGBA32F(uchar *dest, const QRgba32F *src,
|
|||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBX64FromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBX64FromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba64 *d = reinterpret_cast<QRgba64 *>(dest) + index;
|
||||
|
|
@ -2229,7 +2229,7 @@ static void QT_FASTCALL storeRGBX64FromRGBA32F(uchar *dest, const QRgba32F *src,
|
|||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBA64FromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBA64FromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba64 *d = reinterpret_cast<QRgba64 *>(dest) + index;
|
||||
|
|
@ -2239,7 +2239,7 @@ static void QT_FASTCALL storeRGBA64FromRGBA32F(uchar *dest, const QRgba32F *src,
|
|||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBA64PMFromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBA64PMFromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba64 *d = reinterpret_cast<QRgba64 *>(dest) + index;
|
||||
|
|
@ -2247,7 +2247,7 @@ static void QT_FASTCALL storeRGBA64PMFromRGBA32F(uchar *dest, const QRgba32F *sr
|
|||
d[i] = QRgba64::fromRgba64(src[i].red16(), src[i].green16(), src[i].blue16(), src[i].alpha16());
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeGray16FromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeGray16FromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
quint16 *d = reinterpret_cast<quint16 *>(dest) + index;
|
||||
|
|
@ -2257,37 +2257,37 @@ static void QT_FASTCALL storeGray16FromRGBA32F(uchar *dest, const QRgba32F *src,
|
|||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBX16FFromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBX16FFromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba16F *d = reinterpret_cast<QRgba16F *>(dest) + index;
|
||||
QRgbaFloat16 *d = reinterpret_cast<QRgbaFloat16 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
auto s = src[i].unpremultiplied();
|
||||
d[i] = QRgba16F{ s.r, s.g, s.b, 1.0f };
|
||||
d[i] = QRgbaFloat16{ s.r, s.g, s.b, 1.0f };
|
||||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBA16FFromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBA16FFromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba16F *d = reinterpret_cast<QRgba16F *>(dest) + index;
|
||||
QRgbaFloat16 *d = reinterpret_cast<QRgbaFloat16 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
auto s = src[i].unpremultiplied();
|
||||
d[i] = QRgba16F{ s.r, s.g, s.b, s.a };
|
||||
d[i] = QRgbaFloat16{ s.r, s.g, s.b, s.a };
|
||||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBA16FPMFromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBA16FPMFromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba16F *d = reinterpret_cast<QRgba16F *>(dest) + index;
|
||||
QRgbaFloat16 *d = reinterpret_cast<QRgbaFloat16 *>(dest) + index;
|
||||
qFloatToFloat16((qfloat16 *)d, (const float *)src, count * 4);
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBX32FFromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBX32FFromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i) {
|
||||
auto s = src[i].unpremultiplied();
|
||||
s.a = 1.0f;
|
||||
|
|
@ -2295,18 +2295,18 @@ static void QT_FASTCALL storeRGBX32FFromRGBA32F(uchar *dest, const QRgba32F *src
|
|||
}
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBA32FFromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBA32FFromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = src[i].unpremultiplied();
|
||||
}
|
||||
|
||||
static void QT_FASTCALL storeRGBA32FPMFromRGBA32F(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
static void QT_FASTCALL storeRGBA32FPMFromRGBA32F(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *, QDitherInfo *)
|
||||
{
|
||||
QRgba32F *d = reinterpret_cast<QRgba32F *>(dest) + index;
|
||||
QRgbaFloat32 *d = reinterpret_cast<QRgbaFloat32 *>(dest) + index;
|
||||
if (d != src) {
|
||||
for (int i = 0; i < count; ++i)
|
||||
d[i] = src[i];
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
#include <QtCore/qlist.h>
|
||||
#include <QtGui/qimage.h>
|
||||
#include <QtGui/qrgba64.h>
|
||||
#include <QtGui/qrgbaf.h>
|
||||
#include <QtGui/qrgbafloat.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
|
@ -218,14 +218,14 @@ inline unsigned int qConvertRgb64ToRgb30<PixelOrderRGB>(QRgba64 c)
|
|||
return (a << 30) | (r << 20) | (g << 10) | b;
|
||||
}
|
||||
|
||||
inline constexpr QRgba16F qConvertRgb64ToRgbaF16(QRgba64 c)
|
||||
inline constexpr QRgbaFloat16 qConvertRgb64ToRgbaF16(QRgba64 c)
|
||||
{
|
||||
return QRgba16F::fromRgba64(c.red(), c.green(), c.blue(), c.alpha());
|
||||
return QRgbaFloat16::fromRgba64(c.red(), c.green(), c.blue(), c.alpha());
|
||||
}
|
||||
|
||||
inline constexpr QRgba32F qConvertRgb64ToRgbaF32(QRgba64 c)
|
||||
inline constexpr QRgbaFloat32 qConvertRgb64ToRgbaF32(QRgba64 c)
|
||||
{
|
||||
return QRgba32F::fromRgba64(c.red(), c.green(), c.blue(), c.alpha());
|
||||
return QRgbaFloat32::fromRgba64(c.red(), c.green(), c.blue(), c.alpha());
|
||||
}
|
||||
|
||||
inline uint qRgbSwapRgb30(uint c)
|
||||
|
|
@ -307,18 +307,18 @@ typedef void(QT_FASTCALL *ConvertAndStorePixelsFunc64)(uchar *dest, const QRgba6
|
|||
int count, const QList<QRgb> *clut,
|
||||
QDitherInfo *dither);
|
||||
|
||||
typedef const QRgba32F *(QT_FASTCALL *FetchAndConvertPixelsFuncFP)(QRgba32F *buffer, const uchar *src, int index, int count,
|
||||
typedef const QRgbaFloat32 *(QT_FASTCALL *FetchAndConvertPixelsFuncFP)(QRgbaFloat32 *buffer, const uchar *src, int index, int count,
|
||||
const QList<QRgb> *clut, QDitherInfo *dither);
|
||||
typedef void (QT_FASTCALL *ConvertAndStorePixelsFuncFP)(uchar *dest, const QRgba32F *src, int index, int count,
|
||||
typedef void (QT_FASTCALL *ConvertAndStorePixelsFuncFP)(uchar *dest, const QRgbaFloat32 *src, int index, int count,
|
||||
const QList<QRgb> *clut, QDitherInfo *dither);
|
||||
typedef void (QT_FASTCALL *ConvertFunc)(uint *buffer, int count, const QList<QRgb> *clut);
|
||||
typedef void (QT_FASTCALL *Convert64Func)(QRgba64 *buffer, int count);
|
||||
typedef void (QT_FASTCALL *ConvertFPFunc)(QRgba32F *buffer, int count);
|
||||
typedef void (QT_FASTCALL *Convert64ToFPFunc)(QRgba32F *buffer, const quint64 *src, int count);
|
||||
typedef void (QT_FASTCALL *ConvertFPFunc)(QRgbaFloat32 *buffer, int count);
|
||||
typedef void (QT_FASTCALL *Convert64ToFPFunc)(QRgbaFloat32 *buffer, const quint64 *src, int count);
|
||||
|
||||
typedef const QRgba64 *(QT_FASTCALL *ConvertTo64Func)(QRgba64 *buffer, const uint *src, int count,
|
||||
const QList<QRgb> *clut, QDitherInfo *dither);
|
||||
typedef const QRgba32F *(QT_FASTCALL *ConvertToFPFunc)(QRgba32F *buffer, const uint *src, int count,
|
||||
typedef const QRgbaFloat32 *(QT_FASTCALL *ConvertToFPFunc)(QRgbaFloat32 *buffer, const uint *src, int count,
|
||||
const QList<QRgb> *clut, QDitherInfo *dither);
|
||||
typedef void (QT_FASTCALL *RbSwapFunc)(uchar *dst, const uchar *src, int count);
|
||||
|
||||
|
|
|
|||
|
|
@ -37,29 +37,34 @@
|
|||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QRGBAF_H
|
||||
#define QRGBAF_H
|
||||
#ifndef QRGBAFLOAT_H
|
||||
#define QRGBAFLOAT_H
|
||||
|
||||
#include <QtGui/qtguiglobal.h>
|
||||
#include <QtCore/qfloat16.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <type_traits>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
template<typename F>
|
||||
class alignas(sizeof(F) * 4) QRgbaF {
|
||||
class alignas(sizeof(F) * 4) QRgbaFloat
|
||||
{
|
||||
static_assert(std::is_same<F, qfloat16>::value || std::is_same<F, float>::value);
|
||||
public:
|
||||
using Type = F;
|
||||
using FastType = float;
|
||||
F r;
|
||||
F g;
|
||||
F b;
|
||||
F a;
|
||||
|
||||
static constexpr
|
||||
QRgbaF fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)
|
||||
QRgbaFloat fromRgba64(quint16 red, quint16 green, quint16 blue, quint16 alpha)
|
||||
{
|
||||
return QRgbaF{
|
||||
return QRgbaFloat{
|
||||
red * (1.0f / 65535.0f),
|
||||
green * (1.0f / 65535.0f),
|
||||
blue * (1.0f / 65535.0f),
|
||||
|
|
@ -67,16 +72,16 @@ public:
|
|||
}
|
||||
|
||||
static constexpr
|
||||
QRgbaF fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
|
||||
QRgbaFloat fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
|
||||
{
|
||||
return QRgbaF{
|
||||
return QRgbaFloat{
|
||||
red * (1.0f / 255.0f),
|
||||
green * (1.0f / 255.0f),
|
||||
blue * (1.0f / 255.0f),
|
||||
alpha * (1.0f / 255.0f) };
|
||||
}
|
||||
static constexpr
|
||||
QRgbaF fromArgb32(uint rgb)
|
||||
QRgbaFloat fromArgb32(uint rgb)
|
||||
{
|
||||
return fromRgba(quint8(rgb >> 16), quint8(rgb >> 8), quint8(rgb), quint8(rgb >> 24));
|
||||
}
|
||||
|
|
@ -84,19 +89,19 @@ public:
|
|||
constexpr bool isOpaque() const { return a >= 1.0f; }
|
||||
constexpr bool isTransparent() const { return a <= 0.0f; }
|
||||
|
||||
constexpr float red() const { return r; }
|
||||
constexpr float green() const { return g; }
|
||||
constexpr float blue() const { return b; }
|
||||
constexpr float alpha() const { return a; }
|
||||
void setRed(float _red) { r = _red; }
|
||||
void setGreen(float _green) { g = _green; }
|
||||
void setBlue(float _blue) { b = _blue; }
|
||||
void setAlpha(float _alpha) { a = _alpha; }
|
||||
constexpr FastType red() const { return r; }
|
||||
constexpr FastType green() const { return g; }
|
||||
constexpr FastType blue() const { return b; }
|
||||
constexpr FastType alpha() const { return a; }
|
||||
void setRed(FastType _red) { r = _red; }
|
||||
void setGreen(FastType _green) { g = _green; }
|
||||
void setBlue(FastType _blue) { b = _blue; }
|
||||
void setAlpha(FastType _alpha) { a = _alpha; }
|
||||
|
||||
constexpr float redNormalized() const { return std::clamp(static_cast<float>(r), 0.0f, 1.0f); }
|
||||
constexpr float greenNormalized() const { return std::clamp(static_cast<float>(g), 0.0f, 1.0f); }
|
||||
constexpr float blueNormalized() const { return std::clamp(static_cast<float>(b), 0.0f, 1.0f); }
|
||||
constexpr float alphaNormalized() const { return std::clamp(static_cast<float>(a), 0.0f, 1.0f); }
|
||||
constexpr FastType redNormalized() const { return std::clamp(static_cast<FastType>(r), 0.0f, 1.0f); }
|
||||
constexpr FastType greenNormalized() const { return std::clamp(static_cast<FastType>(g), 0.0f, 1.0f); }
|
||||
constexpr FastType blueNormalized() const { return std::clamp(static_cast<FastType>(b), 0.0f, 1.0f); }
|
||||
constexpr FastType alphaNormalized() const { return std::clamp(static_cast<FastType>(a), 0.0f, 1.0f); }
|
||||
|
||||
constexpr quint8 red8() const { return std::lround(redNormalized() * 255.0f); }
|
||||
constexpr quint8 green8() const { return std::lround(greenNormalized() * 255.0f); }
|
||||
|
|
@ -112,24 +117,24 @@ public:
|
|||
constexpr quint16 blue16() const { return std::lround(blueNormalized() * 65535.0f); }
|
||||
constexpr quint16 alpha16() const { return std::lround(alphaNormalized() * 65535.0f); }
|
||||
|
||||
constexpr Q_ALWAYS_INLINE QRgbaF premultiplied() const
|
||||
constexpr Q_ALWAYS_INLINE QRgbaFloat premultiplied() const
|
||||
{
|
||||
return QRgbaF{r * a, g * a, b * a, a};
|
||||
return QRgbaFloat{r * a, g * a, b * a, a};
|
||||
}
|
||||
constexpr Q_ALWAYS_INLINE QRgbaF unpremultiplied() const
|
||||
constexpr Q_ALWAYS_INLINE QRgbaFloat unpremultiplied() const
|
||||
{
|
||||
if (a <= 0.0f)
|
||||
return QRgbaF{0.0f, 0.0f, 0.0f, 0.0f};
|
||||
return QRgbaFloat{0.0f, 0.0f, 0.0f, 0.0f};
|
||||
if (a >= 1.0f)
|
||||
return *this;
|
||||
const float ia = 1.0f / a;
|
||||
return QRgbaF{r * ia, g * ia, b * ia, a};
|
||||
const FastType ia = 1.0f / a;
|
||||
return QRgbaFloat{r * ia, g * ia, b * ia, a};
|
||||
}
|
||||
};
|
||||
|
||||
typedef QRgbaF<float> QRgba32F;
|
||||
typedef QRgbaF<qfloat16> QRgba16F;
|
||||
typedef QRgbaFloat<qfloat16> QRgbaFloat16;
|
||||
typedef QRgbaFloat<float> QRgbaFloat32;
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QRGBAF_H
|
||||
#endif // QRGBAFLOAT_H
|
||||
|
|
@ -26,45 +26,56 @@
|
|||
****************************************************************************/
|
||||
|
||||
/*!
|
||||
\class QRgbaF
|
||||
\brief The QRgbaF struct contains a four part RGBA floating-point color.
|
||||
\class QRgbaFloat
|
||||
\brief The QRgbaFloat struct contains a four part RGBA floating-point color.
|
||||
\since 6.2
|
||||
|
||||
\ingroup painting
|
||||
\inmodule QtGui
|
||||
|
||||
QRgba16F is a 64-bit data-structure containing four 16-bit floating point color channels: Red, green, blue and alpha.
|
||||
QRgba32F is a 128-bit data-structure containing four 32-bit floating point color channels: Red, green, blue and alpha.
|
||||
|
||||
\sa QRgb, QRgba64, QColor
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> QRgbaF<F>::fromRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
|
||||
\typedef QRgbaFloat16
|
||||
\relates QRgbaFloat
|
||||
|
||||
Constructs a QRgbaF value from the four 16-bit integer color channels \a red, \a green, \a blue and \a alpha.
|
||||
A 64-bit data-structure containing four 16-bit floating point color channels: Red, green, blue and alpha.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\typedef QRgbaFloat32
|
||||
\relates QRgbaFloat
|
||||
|
||||
A 128-bit data-structure containing four 32-bit floating point color channels: Red, green, blue and alpha.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> QRgbaFloat<F>::fromRgba64(quint16 r, quint16 g, quint16 b, quint16 a)
|
||||
|
||||
Constructs a QRgbaFloat value from the four 16-bit integer color channels \a red, \a green, \a blue and \a alpha.
|
||||
|
||||
\sa fromRgba()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> QRgbaF<F>::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
|
||||
\fn template<typename F> QRgbaFloat<F>::fromRgba(quint8 red, quint8 green, quint8 blue, quint8 alpha)
|
||||
|
||||
Constructs a QRgbaF value from the four 8-bit color channels \a red, \a green, \a blue and \a alpha.
|
||||
Constructs a QRgbaFloat value from the four 8-bit color channels \a red, \a green, \a blue and \a alpha.
|
||||
|
||||
\sa fromArgb32()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> QRgbaF<F>::fromArgb32(uint rgb)
|
||||
\fn template<typename F> QRgbaFloat<F>::fromArgb32(uint rgb)
|
||||
|
||||
Constructs a QRgbaF value from the 32bit ARGB value \a rgb.
|
||||
Constructs a QRgbaFloat value from the 32bit ARGB value \a rgb.
|
||||
|
||||
\sa fromRgba(), toArgb32()
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> bool QRgbaF<F>::isOpaque() const
|
||||
\fn template<typename F> bool QRgbaFloat<F>::isOpaque() const
|
||||
|
||||
Returns whether the color is fully opaque.
|
||||
|
||||
|
|
@ -72,7 +83,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> bool QRgbaF<F>::isTransparent() const
|
||||
\fn template<typename F> bool QRgbaFloat<F>::isTransparent() const
|
||||
|
||||
Returns whether the color is fully transparent.
|
||||
|
||||
|
|
@ -80,7 +91,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> float QRgbaF<F>::red() const
|
||||
\fn template<typename F> float QRgbaFloat<F>::red() const
|
||||
|
||||
Returns the red color component.
|
||||
|
||||
|
|
@ -88,7 +99,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> void QRgbaF<F>::setRed(float red)
|
||||
\fn template<typename F> void QRgbaFloat<F>::setRed(float red)
|
||||
|
||||
Sets the red color component of this color to \a red.
|
||||
|
||||
|
|
@ -96,7 +107,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> float QRgbaF<F>::green() const
|
||||
\fn template<typename F> float QRgbaFloat<F>::green() const
|
||||
|
||||
Returns the green color component.
|
||||
|
||||
|
|
@ -104,7 +115,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> void QRgbaF<F>::setGreen(float green)
|
||||
\fn template<typename F> void QRgbaFloat<F>::setGreen(float green)
|
||||
|
||||
Sets the green color component of this color to \a green.
|
||||
|
||||
|
|
@ -112,7 +123,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> float QRgbaF<F>::blue() const
|
||||
\fn template<typename F> float QRgbaFloat<F>::blue() const
|
||||
|
||||
Returns the blue color component.
|
||||
|
||||
|
|
@ -120,7 +131,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> void QRgbaF<F>::setBlue(float blue)
|
||||
\fn template<typename F> void QRgbaFloat<F>::setBlue(float blue)
|
||||
|
||||
Sets the blue color component of this color to \a blue.
|
||||
|
||||
|
|
@ -128,7 +139,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> float QRgbaF<F>::alpha() const
|
||||
\fn template<typename F> float QRgbaFloat<F>::alpha() const
|
||||
|
||||
Returns the alpha channel.
|
||||
|
||||
|
|
@ -136,7 +147,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> void QRgbaF<F>::setAlpha(float alpha)
|
||||
\fn template<typename F> void QRgbaFloat<F>::setAlpha(float alpha)
|
||||
|
||||
Sets the alpha of this color to \a alpha.
|
||||
|
||||
|
|
@ -144,7 +155,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> float QRgbaF<F>::redNormalized() const
|
||||
\fn template<typename F> float QRgbaFloat<F>::redNormalized() const
|
||||
|
||||
Returns the red color component normalized to values between \c 0.0f and \c 1.0f.
|
||||
|
||||
|
|
@ -152,7 +163,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> float QRgbaF<F>::greenNormalized() const
|
||||
\fn template<typename F> float QRgbaFloat<F>::greenNormalized() const
|
||||
|
||||
Returns the green color component normalized to values between \c 0.0f and \c 1.0f.
|
||||
|
||||
|
|
@ -160,7 +171,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> float QRgbaF<F>::blueNormalized() const
|
||||
\fn template<typename F> float QRgbaFloat<F>::blueNormalized() const
|
||||
|
||||
Returns the blue color component normalized to values between \c 0.0f and \c 1.0f.
|
||||
|
||||
|
|
@ -168,7 +179,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> float QRgbaF<F>::alphaNormalized() const
|
||||
\fn template<typename F> float QRgbaFloat<F>::alphaNormalized() const
|
||||
|
||||
Returns the alpha channel normalized to values between \c 0.0f and \c 1.0f.
|
||||
|
||||
|
|
@ -176,31 +187,31 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> quint8 QRgbaF<F>::red8() const
|
||||
\fn template<typename F> quint8 QRgbaFloat<F>::red8() const
|
||||
|
||||
Returns the red color component as an 8-bit.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> quint8 QRgbaF<F>::green8() const
|
||||
\fn template<typename F> quint8 QRgbaFloat<F>::green8() const
|
||||
|
||||
Returns the green color component as an 8-bit.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> quint8 QRgbaF<F>::blue8() const
|
||||
\fn template<typename F> quint8 QRgbaFloat<F>::blue8() const
|
||||
|
||||
Returns the blue color component as an 8-bit.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> quint8 QRgbaF<F>::alpha8() const
|
||||
\fn template<typename F> quint8 QRgbaFloat<F>::alpha8() const
|
||||
|
||||
Returns the alpha channel as an 8-bit.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> uint QRgbaF<F>::toArgb32() const
|
||||
\fn template<typename F> uint QRgbaFloat<F>::toArgb32() const
|
||||
|
||||
Returns the color as a 32-bit ARGB value.
|
||||
|
||||
|
|
@ -208,31 +219,31 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> quint16 QRgbaF<F>::red16() const
|
||||
\fn template<typename F> quint16 QRgbaFloat<F>::red16() const
|
||||
|
||||
Returns the red color component as a 16-bit integer.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> quint16 QRgbaF<F>::green16() const
|
||||
\fn template<typename F> quint16 QRgbaFloat<F>::green16() const
|
||||
|
||||
Returns the green color component as a 16-bit integer.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> quint16 QRgbaF<F>::blue16() const
|
||||
\fn template<typename F> quint16 QRgbaFloat<F>::blue16() const
|
||||
|
||||
Returns the blue color component as a 16-bit integer.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> quint16 QRgbaF<F>::alpha16() const
|
||||
\fn template<typename F> quint16 QRgbaFloat<F>::alpha16() const
|
||||
|
||||
Returns the alpha channel as a 16-bit integer.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> QRgbaF QRgbaF<F>::premultiplied() const
|
||||
\fn template<typename F> QRgbaFloat QRgbaFloat<F>::premultiplied() const
|
||||
|
||||
Returns the color with the alpha premultiplied.
|
||||
|
||||
|
|
@ -240,7 +251,7 @@
|
|||
*/
|
||||
|
||||
/*!
|
||||
\fn template<typename F> QRgbaF QRgbaF<F>::unpremultiplied() const
|
||||
\fn template<typename F> QRgbaFloat QRgbaFloat<F>::unpremultiplied() const
|
||||
|
||||
Returns the color with the alpha unpremultiplied.
|
||||
|
||||
Loading…
Reference in New Issue