本文最后更新于 60 天前,其中的信息可能已经有所发展或是发生改变。
这是我的第一篇文章,以下内容由AI生成,仅用于测试。
烟火寻常,皆是温柔
日子大抵是由无数细碎的温柔拼凑而成,不似惊雷般震撼,却如春风拂面,悄悄浸润心底。寻常的清晨,窗外的鸟鸣打破寂静,阳光透过窗帘的缝隙,在地板上洒下细碎的光斑,指尖触碰间,皆是暖意。
午后的时光最是惬意,泡一杯淡淡的清茶,看茶叶在水中缓缓舒展,香气袅袅升起,驱散了所有的疲惫。偶尔抬头,望见窗外的梧桐树,枝叶婆娑,风一吹,便落下几片嫩绿的叶子,打着旋儿轻轻飘落,像是大自然温柔的絮语。
傍晚归家,楼道里传来邻居做饭的香气,夹杂着饭菜的温热气息,格外治愈。灯光次第亮起,每一盏灯下,都藏着一个温暖的小家,藏着细碎的欢喜与牵挂。不必追求轰轰烈烈,不必执着于远方的繁华,眼前的烟火气,便是最动人的幸福。
生活从不是一帆风顺,有风雨,有琐碎,有疲惫,但那些藏在日常里的小美好,就像一束光,照亮前行的路。一顿热饭,一杯热茶,一句关心,一次陪伴,皆是寻常,却也皆是温柔。愿我们都能放慢脚步,珍惜眼前的烟火,在平凡的日子里,遇见属于自己的小确幸,不负时光,不负自己。
int lcd_draw_jpeg(int x, int y, const char *pathname, unsigned char *jpeg_buf, int jpeg_size, int zoom_flag)
{
int img_fd;
unsigned char *img_buf;
int img_size;
unsigned char *argb_buf = lcd_buf;
int x_c = x;
struct jpeg_decompress_struct cinfo;
struct my_error_mgr jerr;
struct stat statbuf;
if (pathname != NULL)
{
img_fd = open(pathname, O_RDWR);
if (img_fd == -1)
{
printf("open jpeg file [ %s ] failed !\n", pathname);
return -1;
}
fstat(img_fd, &statbuf);
img_size = statbuf.st_size;
img_buf = calloc(1, img_size);
read(img_fd, img_buf, img_size);
}
else
{
img_size = jpeg_size;
img_buf = jpeg_buf;
}
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = my_error_exit;
if (setjmp(jerr.setjmp_buffer))
{
jpeg_destroy_decompress(&cinfo);
if (pathname != NULL)
{
close(img_fd);
}
return -1;
}
jpeg_create_decompress(&cinfo);
jpeg_mem_src(&cinfo, img_buf, img_size);
(void)jpeg_read_header(&cinfo, TRUE);
cinfo.scale_num = 1; // 分子
cinfo.scale_denom = zoom_flag; // 分母
(void)jpeg_start_decompress(&cinfo);
int i, r, g, b, color;
while (cinfo.output_scanline < cinfo.output_height)
{
argb_buf = lcd_buf;
(void)jpeg_read_scanlines(&cinfo, (JSAMPARRAY)&argb_buf, 1);
for (i = 0; i < cinfo.output_width; i++)
{
b = *(argb_buf + 2);
g = *(argb_buf + 1);
r = *(argb_buf + 0);
color = b;
color |= (g << 8);
color |= (r << 16);
lcd_draw_point(x, y, color);
argb_buf += 3;
x++;
}
y++;
x = x_c;
}
(void)jpeg_finish_decompress(&cinfo);
jpeg_destroy_decompress(&cinfo);
if (pathname != NULL)
{
close(img_fd);
}
return 0;
}
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。