2 Star 1 Fork 1

耗子很快乐/LVGLBuilder

forked from ssda/LVGLBuilder 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
LVGLImageData.h 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
CURTLab 提交于 2020-07-30 03:05 . Added missing image handler
#ifndef LVGLIMAGEDATA_H
#define LVGLIMAGEDATA_H
#include <QImage>
#include <QIcon>
#include <lvgl/lvgl.h>
class LVGLImageData
{
public:
LVGLImageData();
LVGLImageData(QImage image, QString fileName, QString name);
LVGLImageData(QString fileName, QString name);
LVGLImageData(QJsonObject object);
~LVGLImageData();
enum ColorFormat {
LV_COLOR_1Bit,
LV_COLOR_8Bit,
LV_COLOR_16Bit,
LV_COLOR_24Bit,
LV_COLOR_32Bit
};
bool isValid();
lv_img_dsc_t *img_des();
QString name() const;
QJsonValue toJson() const;
QString fileName() const;
QIcon icon() const;
int width() const;
int height() const;
QString codeName() const;
bool saveAsCode(const QString &fileName) const;
bool saveAsBin(const QString &fileName) const;
ColorFormat colorFormat() const;
void setColorFormat(const ColorFormat &colorFormat);
static QStringList colorFormats();
private:
uint32_t m_size;
uint8_t *m_data;
lv_img_dsc_t m_img_dsc;
QString m_name;
QString m_fileName;
QIcon m_icon;
ColorFormat m_colorFormat;
static constexpr int ICON_SIZE = 128;
};
#endif // LVGLIMAGEDATA_H
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/duhuasong/LVGLBuilder.git
git@gitee.com:duhuasong/LVGLBuilder.git
duhuasong
LVGLBuilder
LVGLBuilder
master

搜索帮助