21 lines
638 B
C++
21 lines
638 B
C++
#pragma once
|
||
|
||
#include <QImage>
|
||
#include <QSize>
|
||
|
||
namespace core {
|
||
|
||
class DepthService final {
|
||
public:
|
||
// 生成 8-bit 深度图:0 最远,255 最近。当前实现为全 0(假深度)。
|
||
static QImage computeFakeDepth(const QSize& size);
|
||
static QImage computeFakeDepthFromBackground(const QImage& background);
|
||
|
||
// 把 8-bit 深度(Grayscale8)映射为伪彩色 ARGB32(带 alpha),用于叠加显示。
|
||
// 约定:depth=0(最远)-> 蓝,depth=255(最近)-> 红(线性插值)。
|
||
static QImage depthToColormapOverlay(const QImage& depth8, int alpha /*0-255*/);
|
||
};
|
||
|
||
} // namespace core
|
||
|