tpDisplay类
ExternUtils
2025-07-05
基础信息
头文件: | include <tpDisplay.h> |
---|---|
Cmake: | None |
发布版本: | V0.1.0 |
继承类: | |
派生类: |
Public 类型
enum tpRotate {
tpRotate_0, tpRotate_90, tpRotate_180,
tpRotate_270
}
Public 成员函数
tpDisplay() | ||
---|---|---|
tpDisplay(tpInt32 screen) | ||
tpDisplay(tpString &name) | ||
tpDisplay(void *display, void *resources, void *output_info, unsigned long output) | ||
~tpDisplay() | ||
tpList< tpDisplayModeParam > | getDisplayMode() | 获取显示器显示模式 |
tpString | getName() | 获取当前显示器的名字 |
getPhysicsHeight() | 获取物理尺寸的高度 | |
getPhysicsWidth() | 获取物理尺寸的宽度 | |
getPiXWMPhysicsHeight() | 获取PiXWM物理尺寸高度 | |
getPiXWMPhysicsWidth() | 获取PiXWM物理尺寸宽度 | |
getResolutionHeight() | 获取当前显示器分辨率高度 | |
getResolutionWidth() | 获取当前显示器分辨率宽度 | |
getRefreshRate() | 获取当前显示器刷新率 | |
getRotation() | 获取旋转角度 | |
getParamNow(tpUInt32 *width, tpUInt32 *height, tpUInt16 *rota, double *refresh) | 获取屏幕当前显示参数 | |
setResolution(tpUInt32 width, tpUInt32 height) | 设置分辨率(只能设置支持的分辨率,否则会失败) | |
setRefreshRate(double rate) | 设置刷新率(只能设置当前分辨率下支持的刷新率,否则会失败) | |
setRotation(tpRotate rotation) | 设置旋转角度 | |
setLight(tpUInt8 light) | 设置亮度(暂不支持) | |
getLight() | 获取屏幕亮度(暂不支持) | |
dp2Px(const uint32_t &_dp, const int32_t &_screenNum=-1) | 将DP值根据当前显示器分辨率转换为像素值(px) | |
sp2Px(const uint32_t &_sp, const int32_t &_screenNum=-1) | 将SP值根据当前显示器分辨率转换为像素值(px) | |
getPiXWMResolutionWidth() | 获取PiXWM的分辨率的宽度 | |
getPiXWMResolutionHeight() | 获取PiXWM的分辨率的宽度 |
成员枚举类型说明
enum tpDisplay::tpRotate
名称 | 值 | 描述 |
---|---|---|
tpRotate_0 | 0 | |
tpRotate_90 | 90 | |
tpRotate_180 | 180 | |
tpRotate_270 | 270 |
成员函数说明
tpDisplay::tpDisplay()
暂无注释...
tpDisplay::tpDisplay(tpInt32 screen)
暂无注释...
tpDisplay::tpDisplay(tpString &name)
暂无注释...
tpDisplay::tpDisplay(void *display, void *resources, void *output_info, unsigned long output)
暂无注释...
tpDisplay::~tpDisplay()
暂无注释...
tpList< tpDisplayModeParam > tpDisplay::getDisplayMode()
点击查看...
获取显示器显示模式
返回值:
显示模式列表
tpString tpDisplay::getName()
点击查看...
获取当前显示器的名字
返回值:
显示器名称
tpInt32 tpDisplay::getPhysicsHeight()
点击查看...
获取物理尺寸的高度
返回值:
返回单位mm
tpInt32 tpDisplay::getPhysicsWidth()
点击查看...
获取物理尺寸的宽度
返回值:
返回单位mm
tpInt32 tpDisplay::getPiXWMPhysicsHeight()
点击查看...
获取PiXWM物理尺寸高度
返回值:
返回单位mm
tpInt32 tpDisplay::getPiXWMPhysicsWidth()
点击查看...
获取PiXWM物理尺寸宽度
返回值:
返回单位mm
tpInt32 tpDisplay::getResolutionHeight()
点击查看...
获取当前显示器分辨率高度
返回值:
分辨率像素高度
tpInt32 tpDisplay::getResolutionWidth()
点击查看...
获取当前显示器分辨率宽度
返回值:
分辨率像素宽度
double tpDisplay::getRefreshRate()
点击查看...
获取当前显示器刷新率
返回值:
刷新率
tpUInt16 tpDisplay::getRotation()
点击查看...
获取旋转角度
返回值:
旋转角度
tpInt32 tpDisplay::getParamNow(tpUInt32 *width, tpUInt32 *height, tpUInt16 *rota, double *refresh)
点击查看...
获取屏幕当前显示参数
返回值:
获取成功返回0,失败返回-1
tpInt32 tpDisplay::setResolution(tpUInt32 width, tpUInt32 height)
点击查看...
设置分辨率(只能设置支持的分辨率,否则会失败)
返回值:
成功返回0,失败返回-1
tpInt32 tpDisplay::setRefreshRate(double rate)
点击查看...
设置刷新率(只能设置当前分辨率下支持的刷新率,否则会失败)
返回值:
成功返回0,失败返回-1
tpInt32 tpDisplay::setRotation(tpRotate rotation)
点击查看...
设置旋转角度
返回值:
linebreak
tpInt32 tpDisplay::setLight(tpUInt8 light)
点击查看...
设置亮度(暂不支持)
返回值:
linebreak
tpInt32 tpDisplay::getLight()
点击查看...
获取屏幕亮度(暂不支持)
返回值:
linebreak
static uint32_t tpDisplay::dp2Px(const uint32_t &_dp, const int32_t &_screenNum=-1)
点击查看...
将DP值根据当前显示器分辨率转换为像素值(px)
返回值:
转换后的px值
static uint32_t tpDisplay::sp2Px(const uint32_t &_sp, const int32_t &_screenNum=-1)
点击查看...
将SP值根据当前显示器分辨率转换为像素值(px)
返回值:
转换后的px值
static tpInt32 tpDisplay::getPiXWMResolutionWidth()
点击查看...
获取PiXWM的分辨率的宽度
返回值:
成功返回宽度,失败返回-1;
static tpInt32 tpDisplay::getPiXWMResolutionHeight()
点击查看...
获取PiXWM的分辨率的宽度
返回值:
成功返回宽度,失败返回-1;