10 : m_image(Overlay->w, Overlay->h, QImage::Format_Indexed8),
18 : m_image(Overlay->w, Overlay->h, QImage::Format_ARGB32),
29 QVector<QRgb> rgbpalette;
30 for (
int i = 0; i < 256; i++)
33 int cr = Palette[i].Cr;
34 int cb = Palette[i].Cb;
36 int r =
std::clamp(
int(y + (1.4022 * (cr - 128))), 0, 0xff);
37 int b =
std::clamp(
int(y + (1.7710 * (cb - 128))), 0, 0xff);
38 int g =
std::clamp(
int((1.7047 * y) - (0.1952 * b) - (0.5647 * r)), 0, 0xff);
39 rgbpalette.push_back(
static_cast<uint>((a << 24) | (r << 16) | (g << 8) | b));
41 m_image.setColorTable(rgbpalette);
51 if (
m_image.format() == QImage::Format_Indexed8)
54 int32_t offset = (Top *
m_image.bytesPerLine()) + Left;
55 for (
int i = 0; i < Height; i++ )
57 memset(&data[offset], 0xff,
static_cast<size_t>(Width));
58 offset +=
m_image.bytesPerLine();
63 QColor transparent(0, 0, 0, 255);
65 painter.setCompositionMode(QPainter::CompositionMode_Source);
66 painter.fillRect(Left, Top, Width, Height, transparent);