CN103902345A - 嵌入式录波器界面实现方法 - Google Patents

嵌入式录波器界面实现方法 Download PDF

Info

Publication number
CN103902345A
CN103902345A CN201210577394.8A CN201210577394A CN103902345A CN 103902345 A CN103902345 A CN 103902345A CN 201210577394 A CN201210577394 A CN 201210577394A CN 103902345 A CN103902345 A CN 103902345A
Authority
CN
China
Prior art keywords
class
interface
cslayer
ports
embedded
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201210577394.8A
Other languages
English (en)
Inventor
孙旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NANJING AEROSPACE YINSHAN ELECTRICAL CO Ltd
Original Assignee
NANJING AEROSPACE YINSHAN ELECTRICAL CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NANJING AEROSPACE YINSHAN ELECTRICAL CO Ltd filed Critical NANJING AEROSPACE YINSHAN ELECTRICAL CO Ltd
Priority to CN201210577394.8A priority Critical patent/CN103902345A/zh
Publication of CN103902345A publication Critical patent/CN103902345A/zh
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

本发明涉及一种嵌入式录波器界面实现方法,包括以下步骤:(1).将framebuffer接口封装成CSPaintDevice类,并提供了"Update"(定时刷新)和"Refresh"(强制刷新)两种界面刷新接口;(2).编写CSLayer类,将绘图的对象由设备转移到对CSLayer的操作,并派生出CSPicture类支持对图片的操作;(3).对CSLayer类的绘图操作由CSPaint的绘图接口来完成;CSPaint类提供了"FillRectangle"(填充矩形)、"DrawRectangle"(画矩形)、"DrawLine"(画线)、"DrawPoint"(画点)、"FillTriangle"(填充三角形)等绘图接口。

Description

嵌入式录波器界面实现方法
技术领域
本发明涉及一种嵌入式录波器界面实现方法。
背景技术
目前国内外很多嵌入式设备界面的设计开发都是使用比较成熟的面向嵌入式的GUI 系统有QtEmbedded 、MicroWindows 、MiniGUI 、WinCE、GTK 等。
这几种GUI 的设计目标仍然是通用性,它们大多支持多窗口的随意切换、覆盖,以及可移动、可动态改变尺寸的窗口,诸如此类在多数嵌入式应用中几乎永远用不到的特性,使得应用程序的开发要考虑很多不必要的细节。
发明内容
本发明的目的在于本发明通过直接调用FrameBuffer接口,开发了一种单界面适用于嵌入式的GUI系统。仅对FrameBuffer接口进行了简单封装,实现了图层、绘点、绘线、填充、窗口等功能。使得整个程序资源占用少,效率高。
为达到上述目的,本发明所采用的技术方案是:一种嵌入式录波器界面实现方法,包括以下步骤:(1).将framebuffer接口封装成CSPaintDevice类,并提供了"Update"(定时刷新)和"Refresh"(强制刷新)两种界面刷新接口;
(2).编写CSLayer类,将绘图的对象由设备转移到对CSLayer的操作,并派生出CSPicture类支持对图片的操作;
    (3).对CSLayer类的绘图操作由CSPaint的绘图接口来完成;CSPaint类提供了"FillRectangle"(填充矩形)、" DrawRectangle"(画矩形)、"DrawLine"(画线)、" DrawPoint"(画点)、" FillTriangle"(填充三角形)等绘图接口。
由于上述技术方案的采用,本发明与现有技术相比,具有以下优点:采用本发明的技术方案,可以很方便高效的绘出图形,完全适用于硬件配置不高但又对图形实时性有要求的场合。避免采用了庞大的图形库造成效率低下和升级硬件增加成本的风险。
具体实施方式
一种嵌入式录波器界面实现方法,包括以下步骤:(1).将framebuffer接口封装成CSPaintDevice类,并提供了"Update"(定时刷新)和"Refresh"(强制刷新)两种界面刷新接口;
(2).编写CSLayer类,将绘图的对象由设备转移到对CSLayer的操作,并派生出CSPicture类支持对图片的操作;
    (3).对CSLayer类的绘图操作由CSPaint的绘图接口来完成;CSPaint类提供了"FillRectangle"(填充矩形)、" DrawRectangle"(画矩形)、"DrawLine"(画线)、" DrawPoint"(画点)、" FillTriangle"(填充三角形)等绘图接口。
本发明采用面向对象的思想设计,采用标准的C++语言编写,程序可以在linux下支持framebuffer驱动的硬件平台上运行。
软件结构如下:
                                                 
 Linux kernel framebuffer 是linux内核的framebuffer驱动层,只要有framebuffer驱动的系统都能使用。
class CSPaintDevice         //设备类
{
private:
    static CSPaintDevice* pDevice;
    int fd;                         //显卡设备描述符
    unsigned char* pDeviceMem;          //显卡设备进程空间地址
    unsigned char* pBbufferMen;         //缓冲地址
    CSPaintDevice();
    void WriteDevice(const unsigned char* mem,unsigned int len);
    void ReadDevice(const  char*& mem,unsigned int& len);
    struct fb_info;
public:
    static CSPaintDevice* GetDevice();
    void Update(CSLayer*);              //定时刷新界面
    void Refresh();                     //强制刷新界面
    void SetInterval(unsigned usec);            //定时刷新间隔
    fb_info* GetFbInfo();
};
CSPaintDevice类实现了与底层framebuffer接口之间的封装,提供了刷新界面接口。程序员只需根据刷新的实时要求选择调用不同的接口。Update(CSLayer*)函数可以刷新多个图层并根据图层内容进行合并刷新。
 
class CSLayer   //图层类
{
private:
    unsigned char* pDeviceMem; //图层内存
    RectInfo* pRectInfo;
public:
    bool CreateLayer(fb_info* pFbInfo);     //根据设备信息创建图层
    void WriteDevice(const unsigned char* mem,unsigned int len);    //写图层内存
class CSPicture:public CSLayer
{
    public:
              CSPicture(const char* path);                   //载入bmp、jpg图片
}
CSLayer提供了绘图的具体空间,所有绘图工作结构均存放在图层的内存当中。图层与设备层分离避免了直接在设备绘图复杂的计算和接口调用。CSPicture提供了图片与图层之间的转换。
CSPaint
{
public:
    CSPaint(CSLayer* pLayer);
    void FillRectangle(RectInfo* rect,RGB24 color );                        //填充矩形
    void DrawRectangle(RectInfo* rect,RGB24 color);                         //画矩形
    void DrawLine(int x1,int y1,int x2,int y2,RGB24 color );                //画线
    void DrawPoint(int x,int y,RGB24 color );                           //画点
    void FillTriangle(int x1,int y1,int x2,int y2,int x3,int y3,RGB24 color);      //填充三角形  
    void SetLayer(CSLayer* pLayer);
    void FillPicture(CSPicture * pLayer);                                   //贴图
private:
    unsigned char* pMem; 
};
CSPaint提供了一组图形操作,分别用于填充矩形、画矩形、画线、画点、填充三角形。
上述实施例只为说明本发明的技术构思及特点,其目的在于让熟悉此项技术的人士能够了解本发明的内容并据以实施,并不能以此限制本发明的保护范围,凡根据本发明精神实质所作的等效变化或修饰,都应涵盖在本发明的保护范围之内。

Claims (1)

1.一种嵌入式录波器界面实现方法,其特征在于,包括以下步骤:(1).将framebuffer接口封装成CSPaintDevice类,并提供了"Update"(定时刷新)和"Refresh"(强制刷新)两种界面刷新接口;
(2).编写CSLayer类,将绘图的对象由设备转移到对CSLayer的操作,并派生出CSPicture类支持对图片的操作;
(3).对CSLayer类的绘图操作由CSPaint的绘图接口来完成;CSPaint类提供了"FillRectangle"(填充矩形)、" DrawRectangle"(画矩形)、"DrawLine"(画线)、" DrawPoint"(画点)、" FillTriangle"(填充三角形)等绘图接口。
CN201210577394.8A 2012-12-27 2012-12-27 嵌入式录波器界面实现方法 Pending CN103902345A (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210577394.8A CN103902345A (zh) 2012-12-27 2012-12-27 嵌入式录波器界面实现方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210577394.8A CN103902345A (zh) 2012-12-27 2012-12-27 嵌入式录波器界面实现方法

Publications (1)

Publication Number Publication Date
CN103902345A true CN103902345A (zh) 2014-07-02

Family

ID=50993684

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210577394.8A Pending CN103902345A (zh) 2012-12-27 2012-12-27 嵌入式录波器界面实现方法

Country Status (1)

Country Link
CN (1) CN103902345A (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5764228A (en) * 1995-03-24 1998-06-09 3Dlabs Inc., Ltd. Graphics pre-processing and rendering system
CN101013369A (zh) * 2007-02-02 2007-08-08 浙江大学 一种嵌入式系统开发平台图形库的优化作图方法
US20070279429A1 (en) * 2006-06-02 2007-12-06 Leonhard Ganzer System and method for rendering graphics
CN101398757A (zh) * 2008-09-28 2009-04-01 深圳创维-Rgb电子有限公司 面向嵌入式系统的人机互动实现方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5764228A (en) * 1995-03-24 1998-06-09 3Dlabs Inc., Ltd. Graphics pre-processing and rendering system
US20070279429A1 (en) * 2006-06-02 2007-12-06 Leonhard Ganzer System and method for rendering graphics
CN101013369A (zh) * 2007-02-02 2007-08-08 浙江大学 一种嵌入式系统开发平台图形库的优化作图方法
CN101398757A (zh) * 2008-09-28 2009-04-01 深圳创维-Rgb电子有限公司 面向嵌入式系统的人机互动实现方法

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JEFFERYZHOU: "《QT的Paint系统》", 《HTTP://WWW.CNBLOGS.COM/JEFFERYZHOU/ARCHIVE/2012/09/24/2700347.HTML》 *
王同洋等: "《嵌入式Linux中图形用户界面的研究与设计》", 《微计算机信息》 *
赵拯宇: "《基于Qt/Embedded和Qtopia的嵌入式GUI研究与实现》", 《中国优秀硕士学位论文全文数据库信息科技辑》 *

Similar Documents

Publication Publication Date Title
CN106251392A (zh) 用于执行交织的方法和设备
CN105487848B (zh) 一种3d应用的显示刷新方法及系统
CN103677777B (zh) 调用应用程序组件的方法及装置
KR102454893B1 (ko) 그래픽 프로세싱 장치 및 그래픽 프로세싱 장치의 동작 방법
JP2018534607A (ja) プリフェッチを用いた効率的な表示処理
CN106537446B (zh) 具有任意块形状的自适应划分机制以用于基于块的渲染gpu架构
CN112269603A (zh) 一种在Linux上兼容运行Android应用的图形显示方法与装置
KR20170132758A (ko) 하이브리드 2d/3d 그래픽 렌더링
US10319068B2 (en) Texture not backed by real mapping
WO2018018941A1 (zh) 利用OpenGL与OpenCL协作实现图像缩放的方法及系统
CN104778022A (zh) 一种数据处理方法及电子设备
CN105321142A (zh) 经由计算流水线进行的采样、错误管理和/或上下文切换
CN101783021B (zh) 实现gpu运算提高dr图像处理速度的方法
CN104020849B (zh) 基于Windows CE的多程序同时显示方法及系统
CN107870794A (zh) 一种车机分区域显示方法及装置
TW201735650A (zh) 用於影像處理器之巨型輸入/輸出單元
CN103902345A (zh) 嵌入式录波器界面实现方法
CN102662674A (zh) 工程三维仿真系统通用开发平台构建方法
JP2018503919A (ja) ベイヤーマッピングを備えたグラフィックス処理ユニット
US20140292617A1 (en) System, method, and computer program product for reducing image artifacts on multiple displays
US20100085367A1 (en) Graphics processing method and apparatus implementing window system
CN102662615A (zh) 一种嵌入式设备及其图片显示方法、系统
CN111324348A (zh) 一种导引设备地面操控台的人机交互界面实现方法
CN105786449A (zh) 基于图形处理的指令调度方法及装置
CN118043842A (zh) 一种渲染格式选择方法及其相关设备

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20190809

AD01 Patent right deemed abandoned