From cb8dbe8a5fc7c6e9f504586624c14e253d85bd61 Mon Sep 17 00:00:00 2001 From: wangyiming Date: Thu, 19 Mar 2026 10:20:33 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix(items/icon):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=9B=BE=E6=A0=87=E6=98=AF=E5=90=A6=E6=9C=89?= =?UTF-8?q?=E5=BA=95=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 判断四条边是否相等修改为判断是否有三条边相等。判断不透明像素点个数是否超过图标宽高的58%修改为是否超过有效区域的58%,判断是否为有底图标时使用透明度大于200的并且不含边角阴影的部分 Bug: #482853 From: kylin Severity: Moderate Changelog-Bug: #482853 【原生适配】安装驱动后,V11系统桌面图标显示有留白,V10SP1系统显示正常 --- items/icon.cpp | 272 +++++++++++++++++++++++++++++++++++++++++++++---- items/icon.h | 4 + 2 files changed, 256 insertions(+), 20 deletions(-) diff --git a/items/icon.cpp b/items/icon.cpp index 994e36ca..b9578464 100644 --- a/items/icon.cpp +++ b/items/icon.cpp @@ -1307,41 +1307,63 @@ bool Icon::isTransparencyBackground(QImage image) || bottomLeft.y() != bottomRight.y() || rightTop.x() != rightBottom.x()) { return true; } - auto threshold = image.width() >= 32? 1 : 0; - if (qAbs((topRight.x() - topLeft.x()) - (bottomRight.x() - bottomLeft.x())) > threshold || qAbs((leftBottom.y() - leftTop.y()) - (rightBottom.y() - rightTop.y())) > threshold) { + + int threshold = image.width() >= 128 ? 5 : image.width()/ 32 + 1; + + if (!judgeSideLengths(leftBottom.y() - leftTop.y(), rightBottom.y() - rightTop.y(), topRight.x() - topLeft.x(), bottomRight.x() - bottomLeft.x(), threshold)) { return true; } - + //找到四条边最长连续不透明像素点个数,排除X形等不规则图形的干扰 int topOpaquePointCount = 0; int bottomOpaquePointCount = 0; int leftOpaquePointCount = 0; int rightOpaquePointCount = 0; + int pointTemp = 0; for (int y = leftTop.y(); y <= leftBottom.y(); ++y) { - if (qAlpha(image.pixel(leftTop.x(), y)) > 25) { - ++leftOpaquePointCount; + if (qAlpha(image.pixel(leftTop.x(), y)) > 127) { + ++pointTemp; + } else { + leftOpaquePointCount = pointTemp > leftOpaquePointCount ? pointTemp : leftOpaquePointCount; + pointTemp = 0; } } - + leftOpaquePointCount = pointTemp > leftOpaquePointCount ? pointTemp : leftOpaquePointCount; + pointTemp = 0; for (int x = topLeft.x(); x <= topRight.x(); ++x) { - if (qAlpha(image.pixel(x, topLeft.y())) > 25) { - ++topOpaquePointCount; + if (qAlpha(image.pixel(x, topLeft.y())) > 127) { + ++pointTemp; + } else { + topOpaquePointCount = pointTemp > topOpaquePointCount ? pointTemp : topOpaquePointCount; + pointTemp = 0; } } + topOpaquePointCount = pointTemp > topOpaquePointCount ? pointTemp : topOpaquePointCount; + pointTemp = 0; for (int y = rightTop.y(); y <= rightBottom.y(); ++y) { - if (qAlpha(image.pixel(rightTop.x(), y)) > 25) { - ++rightOpaquePointCount; + if (qAlpha(image.pixel(rightTop.x(), y)) > 127) { + ++pointTemp; + } else { + rightOpaquePointCount = pointTemp > rightOpaquePointCount ? pointTemp : rightOpaquePointCount; + pointTemp = 0; } } + rightOpaquePointCount = pointTemp > rightOpaquePointCount ? pointTemp : rightOpaquePointCount; + pointTemp = 0; for (int x = bottomLeft.x(); x <= bottomRight.x(); ++x) { - if (qAlpha(image.pixel(x, bottomLeft.y())) > 25) { - ++bottomOpaquePointCount; + if (qAlpha(image.pixel(x, bottomLeft.y())) > 127) { + ++pointTemp; + } else { + bottomOpaquePointCount = pointTemp > bottomOpaquePointCount ? pointTemp : bottomOpaquePointCount; + pointTemp = 0; } } + bottomOpaquePointCount = pointTemp > bottomOpaquePointCount ? pointTemp : bottomOpaquePointCount; + //如果这四条线上的不透明点小于58%则认为无底 (58%来自一个典型的圆形图标 某歌浏览器) - if (topOpaquePointCount < image.width() * 0.58 || - bottomOpaquePointCount < image.width() * 0.58 || - leftOpaquePointCount < image.height() * 0.58 || - rightOpaquePointCount < image.height() * 0.58) { + if (topOpaquePointCount < qRound((rightTop.x() - leftTop.x() + 1) * 0.58) || + bottomOpaquePointCount < qRound((rightBottom.x() - leftBottom.x() + 1) * 0.58) || + leftOpaquePointCount < qRound((bottomLeft.y() - topLeft.y() + 1) * 0.58) || + rightOpaquePointCount < qRound((bottomRight.y() - topRight.y() + 1) * 0.58)) { return true; } return false; @@ -1424,11 +1446,10 @@ void Icon::getImageType(const QImage &effectArea, const QImage &image, int image if(effectArea.isNull()) { d->imageType = Icon::Uninitialized; } - if (isFirstPartyIcon(effectArea, imageSize)) { if (!IconBackgroundUtils::instance()->containShadow(imageSize) && !(effectArea.width() == standardEffectAreaSize && effectArea.height() == effectArea.width())) { - if(!isTransparencyBackground(image)) { + if(!isTransparencyBackground(getNonShadowArea(effectArea))) { d->imageType = RectangleWithBack; } else { d->imageType = Other; @@ -1438,14 +1459,13 @@ void Icon::getImageType(const QImage &effectArea, const QImage &image, int image d->imageType = Icon::FirstParty; return; } - if(qAbs(effectArea.width() - effectArea.height()) >= 2) { if(effectArea.width() > effectArea.height() + 1) { d->imageType = Icon::RectangleHorizontal; } else if (effectArea.width() + 1 < effectArea.height()) { d->imageType = Icon::RectangleVertical; } - } else if(!isTransparencyBackground(image)) { + } else if(!isTransparencyBackground(getNonShadowArea(effectArea))) { d->imageType = Icon::RectangleWithBack; } else { d->imageType = Icon::Other; @@ -1601,4 +1621,216 @@ QHash, int> Icon::getTransparentPoint(const QImage &image) return imageAlphaList; } + +bool Icon::judgeSideLengths(int left, int right, int top, int bottom, int threshold) +{ + int max = std::max({left, right, top}); + int min = std::min({left, right, top}); + if (max - min <= threshold) { + return true; + } + + max = std::max({left, right, bottom}); + min = std::min({left, right, bottom}); + if (max - min <= threshold) { + return true; + } + + max = std::max({left, top, bottom}); + min = std::min({left, top, bottom}); + if (max - min <= threshold) { + return true; + } + + max = std::max({right, top, bottom}); + min = std::min({right, top, bottom}); + if (max - min <= threshold) { + return true; + } + return false; +} + +QImage Icon::getNonShadowArea(QImage image) +{ + if (image.isNull()) { + return image; + } + //找到图标有效区域四个定点的第一个不透明点 + QPoint topLeft; + QPoint topRight; + QPoint leftTop; + QPoint leftBottom; + QPoint rightTop; + QPoint rightBottom; + QPoint bottomLeft; + QPoint bottomRight; + + bool getMax = false; + bool getMin = false; + + uchar *pixels = image.bits(); + const int bytesPerLine = image.bytesPerLine(); // 每行字节数 + + for (int y = 0; y < image.height(); ++y) { + const QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + + for (int x = 0; x < image.width(); ++x) { + if (!getMin && qAlpha(line[x]) > 200) { + topLeft.setX(x); + topLeft.setY(y); + getMin = true; + } + if (!getMax && qAlpha(line[image.width() - x - 1]) > 200) { + topRight.setX(image.width() - x - 1); + topRight.setY(y); + getMax = true; + } + if(getMax && getMin) { + break; + } + } + if(getMax && getMin) { + break; + } + } + + if(!getMax || !getMin) { + return image; + } + + getMax = false; + getMin = false; + for (int y = image.height() - 1; y > 0; --y) { + const QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for (int x = 0; x < image.width(); ++x) { + if (!getMin && qAlpha(line[x]) > 200) { + bottomLeft.setX(x); + bottomLeft.setY(y); + getMin = true; + } + if (!getMax && qAlpha(line[image.width() - x - 1]) > 200) { + bottomRight.setX(image.width() - x - 1); + bottomRight.setY(y); + getMax = true; + } + if(getMax && getMin) { + break; + } + } + if(getMax && getMin) { + break; + } + } + + if(!getMax || !getMin) { + return image; + } + + getMax = false; + getMin = false; + for (int x = 0; x < image.width(); ++x) { + for (int y = 0; y < image.height(); ++y) { + const QRgb *lineTop = reinterpret_cast(pixels + y * bytesPerLine); + const QRgb *lineBottom = reinterpret_cast(pixels + (image.height() - y - 1) * bytesPerLine); + if (!getMin && qAlpha(lineTop[x]) > 200) { + leftTop.setX(x); + leftTop.setY(y); + getMin = true; + } + if (!getMax && qAlpha(lineBottom[x]) > 200) { + leftBottom.setX(x ); + leftBottom.setY(image.height() - y - 1); + getMax = true; + } + if(getMax && getMin) { + break; + } + } + if(getMax && getMin) { + break; + } + } + + if(!getMax || !getMin) { + return image; + } + + getMax = false; + getMin = false; + for (int x = image.width() - 1; x > 0; --x) { + for (int y = 0; y < image.height(); ++y) { + const QRgb *lineTop = reinterpret_cast(pixels + y * bytesPerLine); + const QRgb *lineBottom = reinterpret_cast(pixels + (image.height() - y - 1) * bytesPerLine); + if (!getMin && qAlpha(lineTop[x]) > 200) { + rightTop.setX(x); + rightTop.setY(y); + getMin = true; + } + if (!getMax && qAlpha(lineBottom[x]) > 200) { + rightBottom.setX(x); + rightBottom.setY(image.height() - y - 1); + getMax = true; + } + if(getMax && getMin) { + break; + } + } + if(getMax && getMin) { + break; + } + } + + if(!getMax || !getMin) { + return image; + } + + //将四个角上,透明度低于150的部分设置为0 + for(int y = 0; y < leftTop.y(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = 0; x < topLeft.x(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 150) { + color = qRgba(0, 0, 0, 0); + } + } + } + + for(int y = leftBottom.y(); y < image.height(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = 0; x < bottomLeft.x(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 150) { + color = qRgba(0, 0, 0, 0); + } + } + } + + for(int y = 0; y < rightTop.y(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = topRight.x(); x < image.width(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 150) { + color = qRgba(0, 0, 0, 0); + } + } + } + + for(int y = rightBottom.y(); y < image.height(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = bottomRight.x(); x < image.width(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 150) { + color = qRgba(0, 0, 0, 0); + } + } + } + + int top = topLeft.y() < topRight.y() ? topLeft.y() : topRight.y(); + int bottom = bottomLeft.y() > bottomRight.y() ? bottomLeft.y() : bottomRight.y(); + int left = leftTop.x() < leftBottom.x() ? leftTop.x() : leftBottom.x(); + int right = rightTop.x() > rightBottom.x() ? rightTop.x() : rightBottom.x(); + + return image.copy(left, top, right - left + 1, bottom - top + 1); +} + } // UkuiQuick diff --git a/items/icon.h b/items/icon.h index ffb54185..b620bbad 100644 --- a/items/icon.h +++ b/items/icon.h @@ -186,6 +186,10 @@ private: bool isImagePureColor(QImage &image); QHash, int> getTransparentPoint(const QImage &image); + //判断图片的是否有三条边长度相等 + bool judgeSideLengths(int left, int right, int top, int bottom, int threshold); + //获取图片的无阴影区域 + QImage getNonShadowArea(QImage image); }; } // UkuiQuick -- Gitee From a9ace992663f2baf73b27b1157becb0612d1c4ab Mon Sep 17 00:00:00 2001 From: wangyiming Date: Wed, 25 Mar 2026 10:07:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat(items/icon):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=A1=A5=E5=85=A8=E6=9C=89=E5=BA=95=E5=9B=BE=E6=A0=87=E8=BE=B9?= =?UTF-8?q?=E8=A7=92=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按照距离最近不透明像素颜色补全有底图标的边角区域 Task: #598265 From: kylin Severity: Low Changelog-Other: 第三方图标统一绘制功能,有底图标绘制效果优化 Changelog-Break: 改动影响域,第三方图标统一绘制功能 --- items/icon.cpp | 277 ++++++++++++++++++++++++++++++++++++++++++++++++- items/icon.h | 2 + 2 files changed, 276 insertions(+), 3 deletions(-) diff --git a/items/icon.cpp b/items/icon.cpp index b9578464..02cac964 100644 --- a/items/icon.cpp +++ b/items/icon.cpp @@ -1132,6 +1132,7 @@ QImage Icon::addIconBox(QImage &image) } //有底图标按照第一方规范裁剪圆角并缩放至背景区域大小 case Icon::RectangleWithBack : { + completeImagePixal(effectiveArea); if(IconBackgroundUtils::instance()->containShadow(image.width())) { effectiveArea = clipBackground(effectiveArea, backImageNoShadow, backImageEffectArea.rect()); cliped = true; @@ -1697,9 +1698,9 @@ QImage Icon::getNonShadowArea(QImage image) if(!getMax || !getMin) { return image; } - getMax = false; getMin = false; + for (int y = image.height() - 1; y > 0; --y) { const QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); for (int x = 0; x < image.width(); ++x) { @@ -1725,9 +1726,9 @@ QImage Icon::getNonShadowArea(QImage image) if(!getMax || !getMin) { return image; } - getMax = false; getMin = false; + for (int x = 0; x < image.width(); ++x) { for (int y = 0; y < image.height(); ++y) { const QRgb *lineTop = reinterpret_cast(pixels + y * bytesPerLine); @@ -1754,9 +1755,9 @@ QImage Icon::getNonShadowArea(QImage image) if(!getMax || !getMin) { return image; } - getMax = false; getMin = false; + for (int x = image.width() - 1; x > 0; --x) { for (int y = 0; y < image.height(); ++y) { const QRgb *lineTop = reinterpret_cast(pixels + y * bytesPerLine); @@ -1833,4 +1834,274 @@ QImage Icon::getNonShadowArea(QImage image) return image.copy(left, top, right - left + 1, bottom - top + 1); } +void Icon::completeImagePixal(QImage& image) +{ + if (image.isNull()) { + return; + } + //找到图标有效区域四个定点的第一个不透明点 + QPoint topLeft; + QPoint topRight; + QPoint leftTop; + QPoint leftBottom; + QPoint rightTop; + QPoint rightBottom; + QPoint bottomLeft; + QPoint bottomRight; + + bool getMax = false; + bool getMin = false; + + uchar *pixels = image.bits(); + const int bytesPerLine = image.bytesPerLine(); // 每行字节数 + + for(int y = 0; y < image.height(); ++y) { + const QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = 0; x < image.width(); ++x) { + if(!getMin && qAlpha(line[x]) == 255) { + topLeft.setX(x); + topLeft.setY(y); + getMin = true; + } + if(!getMax && qAlpha(line[image.width() - x - 1]) == 255) { + topRight.setX(image.width() - x - 1); + topRight.setY(y); + getMax = true; + } + if(getMax && getMin) { + break; + } + } + if(getMax && getMin) { + break; + } + } + + if(!getMax || !getMin) { + return; + } + getMax = false; + getMin = false; + + for(int y = image.height() - 1; y > 0; --y) { + const QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = 0; x < image.width(); ++x) { + if(!getMin && qAlpha(line[x]) == 255) { + bottomLeft.setX(x); + bottomLeft.setY(y); + getMin = true; + } + if(!getMax && qAlpha(line[image.width() - x - 1]) == 255) { + bottomRight.setX(image.width() - x - 1); + bottomRight.setY(y); + getMax = true; + } + if(getMax && getMin) { + break; + } + } + if(getMax && getMin) { + break; + } + } + if(!getMax || !getMin) { + return; + } + getMax = false; + getMin = false; + + for(int x = 0; x < image.width(); ++x) { + for(int y = 0; y < image.height(); ++y) { + const QRgb* lineTop = reinterpret_cast(pixels + y * bytesPerLine); + const QRgb* lineBottom = reinterpret_cast(pixels + (image.height() - y - 1) * bytesPerLine); + if(!getMin && qAlpha(lineTop[x]) == 255) { + leftTop.setX(x); + leftTop.setY(y); + getMin = true; + } + if(!getMax && qAlpha(lineBottom[x]) == 255) { + leftBottom.setX(x ); + leftBottom.setY(image.height() - y - 1); + getMax = true; + } + if(getMax && getMin) { + break; + } + } + if(getMax && getMin) { + break; + } + } + + if(!getMax || !getMin) { + return; + } + getMax = false; + getMin = false; + + for(int x = image.width() - 1; x > 0; --x) { + for(int y = 0; y < image.height(); ++y) { + const QRgb* lineTop = reinterpret_cast(pixels + y * bytesPerLine); + const QRgb* lineBottom = reinterpret_cast(pixels + (image.height() - y - 1) * bytesPerLine); + if(!getMin && qAlpha(lineTop[x]) == 255) { + rightTop.setX(x); + rightTop.setY(y); + getMin = true; + } + if(!getMax && qAlpha(lineBottom[x]) == 255) { + rightBottom.setX(x); + rightBottom.setY(image.height() - y - 1); + getMax = true; + } + if(getMax && getMin) { + break; + } + } + if(getMax && getMin) { + break; + } + } + + if(!getMax || !getMin) { + return; + } + + //将四条边上透明部分进行填充,上边下边按照Y轴最近不透明像素点进行填充,左边右边按照X轴最近不透明像素点进行填充 + int top = topLeft.y() > topRight.y() ? topLeft.y() : topRight.y(); + int bottom = bottomLeft.y() < bottomRight.y() ? bottomLeft.y() : bottomRight.y(); + int left = leftTop.x() > leftBottom.x() ? leftTop.x() : leftBottom.x(); + int right = rightTop.x() < rightBottom.x() ? rightTop.x() : rightBottom.x(); + + for(int y = 0; y < top; ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = topLeft.x(); x < topRight.x(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 250) { + for(int i = y; i < image.height(); ++i) { + QRgb* lineTemp = reinterpret_cast(pixels + i * bytesPerLine); + QRgb &rgb = lineTemp[x]; + if(qAlpha(rgb) >= 250) { + color = qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), 255); + break; + } + } + } + } + } + + for(int y = bottom; y < image.height(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = bottomLeft.x(); x < bottomRight.x(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 250) { + for(int i = y; i >= 0; --i) { + QRgb* lineTemp = reinterpret_cast(pixels + i * bytesPerLine); + QRgb &rgb = lineTemp[x]; + if(qAlpha(rgb) >= 250) { + color = qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), 255); + break; + } + } + } + } + } + + for(int y = leftTop.y(); y < leftBottom.y(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = 0; x < left; ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 250) { + for(int i = x + 1; i < image.width(); ++i) { + QRgb &rgb = line[i]; + if(qAlpha(rgb) >= 250) { + color = qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), 255); + break; + } + } + } + } + } + + for(int y = rightTop.y(); y < rightBottom.y(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = image.width() - 1; x > right; --x) { + QRgb &color = line[x]; + if(qAlpha(color) < 250) { + for(int i = x - 1; i > 0; --i) { + QRgb &rgb = line[i]; + if(qAlpha(rgb) >= 250) { + color = qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), 255); + break; + } + } + } + } + } + + //将四个角上,透明度小于250的部分设置为x方向上最近的透明度大于250的像素点颜色 + for(int y = 0; y < leftTop.y(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = 0; x < topLeft.x(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 250) { + for(int i = x + 1; i < image.width(); ++i) { + QRgb &rgb = line[i]; + if(qAlpha(rgb) >= 250) { + color = qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), 255); + break; + } + } + } + } + } + + for(int y = leftBottom.y(); y < image.height(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = 0; x < bottomLeft.x(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 250) { + for(int i = x + 1; i < image.width(); ++i) { + QRgb &rgb = line[i]; + if(qAlpha(rgb) >= 250) { + color = qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), 255); + break; + } + } + } + } + } + + for(int y = 0; y < rightTop.y(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = topRight.x(); x < image.width(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 250) { + for(int i = x - 1; i > 0; --i) { + QRgb &rgb = line[i]; + if(qAlpha(rgb) >= 250) { + color = qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), 255); + break; + } + } + } + } + } + + for(int y = rightBottom.y(); y < image.height(); ++y) { + QRgb* line = reinterpret_cast(pixels + y * bytesPerLine); + for(int x = bottomRight.x(); x < image.width(); ++x) { + QRgb &color = line[x]; + if(qAlpha(color) < 250) { + for(int i = x - 1; i > 0; --i) { + QRgb &rgb = line[i]; + if(qAlpha(rgb) >= 250) { + color = qRgba(qRed(rgb), qGreen(rgb), qBlue(rgb), 255); + break; + } + } + } + } + } +} + } // UkuiQuick diff --git a/items/icon.h b/items/icon.h index b620bbad..6c515ebb 100644 --- a/items/icon.h +++ b/items/icon.h @@ -190,6 +190,8 @@ private: bool judgeSideLengths(int left, int right, int top, int bottom, int threshold); //获取图片的无阴影区域 QImage getNonShadowArea(QImage image); + //按照距离最近不透明像素颜色补全有底图标的边角区域 + void completeImagePixal(QImage& image); }; } // UkuiQuick -- Gitee