惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Security Latest
Security Latest
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
GbyAI
GbyAI
云风的 BLOG
云风的 BLOG
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
Threat Research - Cisco Blogs
NISL@THU
NISL@THU
Spread Privacy
Spread Privacy
P
Proofpoint News Feed
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
MyScale Blog
MyScale Blog
T
Tor Project blog
P
Proofpoint News Feed
C
CERT Recently Published Vulnerability Notes
P
Privacy & Cybersecurity Law Blog
MongoDB | Blog
MongoDB | Blog
Simon Willison's Weblog
Simon Willison's Weblog
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
小众软件
小众软件
G
GRAHAM CLULEY
P
Privacy International News Feed
AWS News Blog
AWS News Blog
Know Your Adversary
Know Your Adversary
P
Palo Alto Networks Blog
人人都是产品经理
人人都是产品经理
S
Schneier on Security
Scott Helme
Scott Helme
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
B
Blog RSS Feed
T
The Exploit Database - CXSecurity.com
Recent Announcements
Recent Announcements
E
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
U
Unit 42
The Register - Security
The Register - Security
S
Securelist
Martin Fowler
Martin Fowler
Project Zero
Project Zero
大猫的无限游戏
大猫的无限游戏
Cisco Talos Blog
Cisco Talos Blog

博客园 - 西北逍遥

实验启动指令 yolov8-pose监测人体关节并保存关节坐标 osg3.6绘制半球体 kinova jaco2 机械臂控制器故障灯闪烁(双绿灯)问题解决方法 IFC标准在学术界的研究与发展历程:从理论探索到产业实践的全面梳理IFC标准在学术界的研究与发展历程:从理论探索到产业实践的全面梳理 BIM的“普通话”:解密IFC标准如何重塑建筑行业 IfcCrewResource Qt重置 Brush pyqt 操作mysql数据库 泵仿真 Qt折线的显示与隐藏 Qt绘制折线 livox mid-70采集点云数据 随机配色 学习:LED灯闪烁 win10安装neo4j-community-3.5.7-windows win10安装MongoDB 3.0.15 Community python把图片合并成gif图 ubuntu20.04测试cuda start.bat Djstra求解最短路径
c++ Qt绘制传热云图
西北逍遥 · 2025-12-16 · via 博客园 - 西北逍遥
#ifndef THERMAL_COLOR_MAP_H
#define THERMAL_COLOR_MAP_H

#include <QVector>
#include <QColor>

class ThermalColorMap {
public:
    ThermalColorMap() {
        // 冷色调到热色调渐变
        colors << QColor(0, 0, 255)   // 冷蓝
               << QColor(0, 255, 255) //
               << QColor(0, 255, 0)   // 绿
               << QColor(255, 255, 0) //
               << QColor(255, 128, 0) //
               << QColor(255, 0, 0);  // 热红
    }

    QColor getColor(double value) const {
        if (colors.isEmpty()) return Qt::white;
        if (value <= 0) return colors.first();
        if (value >= 1) return colors.last();
        
        int index = static_cast<int>(value * (colors.size() - 1));
        QColor start = colors[index];
        QColor end = colors[index + 1];
        double ratio = value * (colors.size() - 1) - index;
        return QColor::fromRgbF(
            start.redF() * (1 - ratio) + end.redF() * ratio,
            start.greenF() * (1 - ratio) + end.greenF() * ratio,
            start.blueF() * (1 - ratio) + end.blueF() * ratio
        );
    }

private:
    QVector<QColor> colors;
};

#endif // THERMAL_COLOR_MAP_H

c83a86b5d1541079d81675ce8172dff7

#############################