xkk6663/mcu_rgb565_bmp

0.1.0

Latest
uploaded 6 hours ago
RGB565 framebuffer to 24-bit BMP encoder in pure C

Readme

# mcu_rgb565_bmp

## 安装

```powershell
idf.py add-dependency "xkk6663/mcu_rgb565_bmp^0.1.0"
```

RGB565 帧到 24-bit BMP 的纯 C 编码器。

## 特性

- 只依赖 `string.h` / `stdint.h`
- 负责 BMP 头、4 字节行跨度、逐行 RGB565 → BGR888
- 不负责 framebuffer 获取、LVGL 锁、HTTP 发送;这些由调用方决定

## 拖入别的工程

复制 `components/mcu_rgb565_bmp/`,声明依赖:

```cmake
idf_component_register(... PRIV_REQUIRES mcu_rgb565_bmp)
```

```c
#include "mcu_rgb565_bmp.h"

uint8_t hdr[MCU_RGB565_BMP_HDR];
mcu_rgb565_bmp_header(hdr, w, h);
const size_t stride = mcu_rgb565_bmp_stride(w);
for (int y = 0; y < h; y++) {
    mcu_rgb565_bmp_row(rgb565, w, y, row);
    fwrite(row, 1, w * 3, f);      // 行尾 padding 由调用方补
}
```

## 测试

`test/test_rgb565_bmp.c` 校验 54 字节头、行跨度对齐、红/绿/蓝/黑/白五种像素的 BGR 输出。

Links

Supports all targets

To add this component to your project, run:

idf.py add-dependency "xkk6663/mcu_rgb565_bmp^0.1.0"

download archive

Stats

  • Archive size
    Archive size ~ 4.61 KB
  • Downloaded in total
    Downloaded in total 0 times
  • Downloaded this version
    This version: 0 times

Badge

xkk6663/mcu_rgb565_bmp version: 0.1.0
|