#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <stdint.h>
#include "jpeglib.h"
#include <sys/mman.h>
#include <setjmp.h>
#include <stdbool.h>
//#define BMP_FILE "ikun2.jpg"
#define LCD_DEVICE "/dev/fb0"
#define NUM_FILES 10 // 定义需要处理的JPEG文件数量
int* lcd_ptr;
int w;
int h;
int lcd_fd;
char *data=0;
int red = 0x00ff0000;
int blue = 0xff;
int green = 0x0000ff00;
int orange=0xff7f00;
int cyan=0xffff;
int purple=0x8B00ff;
int yellow=0xffff00;
int white=0xffffff;
/* 声明错误处理函数 */
void my_error_exit(j_common_ptr cinfo);
struct my_error_mgr {
struct jpeg_error_mgr pub;
jmp_buf setjmp_buffer;
};
typedef struct my_error_mgr * my_error_ptr;
/* 读取JPEG文件并解码为RGB数据 */
int read_jpeg_file(const char* filename, char **data)
{
/* libjpeg解压缩对象cinfo,错误处理对象jerr */
struct jpeg_decompress