• 主控芯片中有一个LCD控制器,其上引出许多引脚可以用来连接一个LCD
    • 可以认为LCD就是由一个个像素组成的画板,有N行,每行有M个像素
    • 每个像素一般可以由8/16/32bit来表示
    • LCD控制器会去所谓的显存frame buffer上一个个的取出数据(RGB)发给LCD,从第一个像素开始到最后一个像素;取完最后一个像素后LCD控制器又会回到第一个像素从新开始取数据,一致循环
    • image.png
    • 显存中存放的是像素的RGB数据
    • jpeg是压缩的图片文件

      jpeg一般指JPEG格式。JPEG(Joint Photographic Experts Group)是JPEG标准的产物,该标准由国际标准化组织(ISO)制订,是面向连续色调静止图像的一种压缩标准。JPEG格式是最常用的图像文件格式,后缀名为.jpg或.jpeg。

    • 要先从jpeg图片中得到RGB数据存到显存中,LCD控制器才能取得数据发给LCD显示

    • bmp中存放的就是RGB原始数据,其起始位置有N字节的文件头用于描述文件的一些属性
    • libjpeg库解压jpeg图片

    image.png
    image.png

    1. Data formats
    2. ------------
    3. Before diving into procedural details, it is helpful to understand the
    4. image data format that the JPEG library expects or returns.
    5. The standard input image format is a rectangular array of pixels, with each
    6. pixel having the same number of "component" or "sample" values (color
    7. channels). You must specify how many components there are and the colorspace
    8. interpretation of the components. Most applications will use RGB data
    9. (three components per pixel) or grayscale data (one component per pixel).
    10. PLEASE NOTE THAT RGB DATA IS THREE SAMPLES PER PIXEL, GRAYSCALE ONLY ONE.
    11. A remarkable number of people manage to miss this, only to find that their
    12. programs don't work with grayscale JPEG files.
    13. Pixels are stored by scanlines, with each scanline running from left to
    14. right. The component values for each pixel are adjacent in the row; for
    15. example, R,G,B,R,G,B,R,G,B,... for 24-bit RGB color. Each scanline is an
    16. array of data type JSAMPLE --- which is typically "unsigned char", unless
    17. you've changed jmorecfg.h. (You can also change the RGB pixel layout, say
    18. to B,G,R order, by modifying jmorecfg.h. But see the restrictions listed in
    19. that file before doing so.)
    20. A 2-D array of pixels is formed by making a list of pointers to the starts of
    21. scanlines; so the scanlines need not be physically adjacent in memory. Even
    22. if you process just one scanline at a time, you must make a one-element
    23. pointer array to conform to this structure. Pointers to JSAMPLE rows are of
    24. type JSAMPROW, and the pointer to the pointer array is of type JSAMPARRAY.
    • libjpeg处理的图片一般个矩形,矩形中是一行一行的数据
    • 每行数据称为scanline
    • 每行中有N多个像素,像素值含有 “component” or “sample”,对于RGB数据每个像素有3个component
    • 二维数组

    • Decompression details

    • image.png
    • image.png
    • image.png
    • image.png
    • image.png
    • image.png
    • image.png
    • image.png

    libjpeg使用

    • 编译libjpeg库
    • image.png
    • 编译jpeg2rgb程序

    image.png

    • 将libjpeg库放入交叉编译工具链中

    image.png

    • 设置图片放大缩小

    image.png

    • 缩小倍数并不是每个值都可以,1/2 1/3 1/4 1/6 1/8 …这些缩小倍数可能有些实现不了
    • this is not likely to be implemented any time soon

    image.png