随笔分类 - 示例代码
摘要:一、 概述 将RGB图片打在YUV上需要注意的是, 字体之外应该透明, 否则背景也会被覆盖不好看, 所以RGB必须有透明度, 本测试格式为BMP ARGB8888(也即B是最低字节, A是最高字节), YUV格式为NV21(YUV420SP), 第一步是将ARGB转换成NV21, 然后小NV21打在
阅读全文
摘要:一、介绍 BMP文件格式,又称为位图,是Windows系统中广泛使用的图像文件格式。 BMP文件的数据分为四个部分: bmp文件头(bmp file header):提供文件的格式、大小等信息 位图信息头(bitmap information):提供图像数据的尺寸、位平面数、压缩方式、颜色索引等信息
阅读全文
摘要:#include int checkCPU() { union w{ int a; char b; }c; c.a = 1; return (c.b == 1); } int main() { printf("This CPU is %s\n", checkCPU() ? "little" : "big"); ...
阅读全文
摘要:#include #define LINUX_REBOOT_CMD_RESTART 0x01234567 int main() { reboot(LINUX_REBOOT_CMD_RESTART); return 0; }
阅读全文
摘要:/* main.c */ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <stdio.h> #include <string.h> #include <unist
阅读全文
摘要:/* uart_tx.c */ #include #include #include #include #include #include #include #include #include #include #define TEST_LEN (1024 * 400) static char *dev_name = "/dev/ttyS2"; static int bau...
阅读全文