<commit_before>// Copyright (c) 2014 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "scicon.h"

#include <QApplication>
#include <QColor>
#include <QIcon>
#include <QImage>
#include <QPalette>
#include <QPixmap>

static void MakeSingleColorImage(QImage& img, const QColor& colorbase)
{
    img = img.convertToFormat(QImage::Format_ARGB32);
    for (int x = img.width(); x--; )
    {
        for (int y = img.height(); y--; )
        {
            const QRgb rgb = img.pixel(x, y);
            img.setPixel(x, y, qRgba(colorbase.red(), colorbase.green(), colorbase.blue(), qAlpha(rgb)));
        }
    }
}

QImage SingleColorImage(const QString& filename, const QColor& colorbase)
{
    QImage img(filename);
#if !defined(WIN32) && !defined(MAC_OSX)
    MakeSingleColorImage(img, colorbase);
#endif
    return img;
}

QIcon SingleColorIcon(const QIcon& ico, const QColor& colorbase)
{
#if defined(WIN32) || defined(MAC_OSX)
    return ico;
#else
    QIcon new_ico;
    QSize sz;
    Q_FOREACH(sz, ico.availableSizes())
    {
        QImage img(ico.pixmap(sz).toImage());
        MakeSingleColorImage(img, colorbase);
        new_ico.addPixmap(QPixmap::fromImage(img));
    }
    return new_ico;<commit_msg>qt: fix unused function warning in scicon.cpp<commit_after>// Copyright (c) 2014 The Bitcoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "scicon.h"

#include <QApplication>
#include <QColor>
#include <QIcon>
#include <QImage>
#include <QPalette>
#include <QPixmap>

namespace {

void MakeSingleColorImage(QImage& img, const QColor& colorbase)
{
    img = img.convertToFormat(QImage::Format_ARGB32);
    for (int x = img.width(); x--; )
    {
        for (int y = img.height(); y--; )
        {
            const QRgb rgb = img.pixel(x, y);
            img.setPixel(x, y, qRgba(colorbase.red(), colorbase.green(), colorbase.blue(), qAlpha(rgb)));
        }
    }
}

}

QImage SingleColorImage(const QString& filename, const QColor& colorbase)
{
    QImage img(filename);
#if !defined(WIN32) && !defined(MAC_OSX)
    MakeSingleColorImage(img, colorbase);
#endif
    return img;
}

QIcon SingleColorIcon(const QIcon& ico, const QColor& colorbase)
{
#if defined(WIN32) || defined(MAC_OSX)
    return ico;
#else
    QIcon new_ico;
    QSize sz;
    Q_FOREACH(sz, ico.availableSizes())
    {
        QImage img(ico.pixmap(sz).toImage());
        MakeSingleColorImage(img, colorbase);
        new_ico.addPixmap(QPixmap::fromImage(img));
    }
    return new_ico;
{'fraction_non_alphanumeric': 0.13624583487597186, 'fraction_numerical': 0.0074046649389115145, 'mean_word_length': 3.533557046979866, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2049885', 'n_tokens_mistral': 943, 'n_tokens_neox': 917, 'n_words': 219}