没有Linux的嵌入式系统的图形库

没有Linux的嵌入式系统的图形库

本文介绍了没有Linux的嵌入式系统的图形库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎任何类型的图形库,如或需要一些底层操作系统,如Linux或uClinux。



软件用于微控制器,只需512kb的闪存,LCD显示屏和触摸屏来显示和处理一些图片和GUI部件。



你知道任何只需要一个指向视频存储器的指针也可以处理线,图像和字体?

解决方案

当您纳入一些第三方解决方案可能只是自己写了。



对于大多数(如果不是全部)环境,屏幕只是像素的二维数组。有时候托盘有时不是,但这并不重要,你可以写下你想要的。



有很多免费代码,用于绘制线条和弧线等。 / p>

杀手可能是字体,但我认为你会发现第三方应用程序会嚼你的内存只是做字体,你资源有限,所以你会想预先计算字体并复制位。



创建一个二维数据数组,首先在您最喜爱的主机上完成所有工作,这是微不足道的保存.bmp文件,如果你想看到你正在绘制的东西,如果你想观看一些动作,将一系列.bmp文件转换成视频是微不足道的。



如果您使用通用C,并且没有libc调用(写入您自己的memcpy,memset等),则此代码将在主机上运行,​​并在目标上运行。



字体将成为您必须预先计算的杀手,但可以将该信息压缩到尽可能小的位置,并在运行时提取数据,将每个字母的位复制到虚拟屏幕中尽可能快。



或者只要购买许多lcd解决方案之一,为您完成所有这些发送命令像Hello World!在某些(x,y)使用蓝色作为前景和白色作为背景。



基本上,我认为非os解决方案仍将使用太多的库,对于您的特定应用程序来说太大了。 2d数组的字节或像素是微不足道的管理自己。即使您正在为桌面平台编写应用程序,我将以这种方式执行此操作,并在最后一刻将完全重映射的屏幕更新复制到某个依赖于OS的库(允许从一个操作系统或另一个操作系统获得最大可移植性)。


It seems that any kind of graphic library like DirectFB or MiniGui requires some sort of underlying operation system like Linux or uClinux.

I am challenged with writing a software for a micro controller with just 512kb flash, an LCD display and a touchscreen to display and handle some pictures and GUI parts.

Do you know any library which just need a pointer to the video memory that also can handle lines, images and fonts?

解决方案

By the time you incorporate some third party solution you could have just written it yourself.

For most if not all environments the screen is just a two dimensional array of pixels. Sometimes palletized sometimes not, but that doesnt matter, you can write yours however you want.

There is tons of free code out there for drawing lines and arcs, etc.

The killer may be fonts but I think you will find that a third party app will chew up all of your memory just doing fonts, you are resource limited so you will want to pre-compute the fonts and just copy the bits.

Make a two dimensional array of data, do all of your work on your favorite host at first, it is trivial to save .bmp files if you want to see what you are drawing, and trivial to turn a series of .bmp files into a video if you want to watch some action.

If you use generic C, and no libc calls (write your own memcpy, memset, etc) this code will run anywhere, on the host for development and on the target.

Fonts are going to be your killer you have to pre-compute them but manage to squeeze that info down into as small as you can, and at runtime extract the data and copy the bits for each letter into the virtual screen as fast as you can.

Or just buy one of the many lcd solutions that do all of this for you and you simply send it commands like draw "Hello World!" at some (x,y) using blue as the foreground and white as the background.

Basically I think the non-os solutions are still going to use too many libraries and be too big for your specific application. 2d arrays of bytes or pixels are trivial to manage yourself. Even if you are writing an application for a desktop platform I would do it this way and at the last minute copy the fully renedered screen update to some os dependent library (allows for maximum portability from one OS or not to another).

这篇关于没有Linux的嵌入式系统的图形库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 15:19