原始图像: 24位BMP图像
图像大小484*484
#include <stdio.h>
#include <stdlib.h>
#include<malloc.h>
#include <pthread.h>
#include <sys/shm.h>
#include<sys/types.h>
#include<sys/ipc.h>
#include<unistd.h>
#pragma pack(2)
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
//typedef long LONG;
//位图文件头定义
typedef struct BMP_FILE_HEADER
{
WORD bType; //文件类型
DWORD bSize;
WORD bReserved1;
WORD bReserved2;
DWORD bOffset;
} __attribute__((packed)) BMPFILEHEADER;
// 位图信息头定义
typedef struct BMP_INFO
{
DWORD bInfoSize;
DWORD bWidth;
DWORD bHeight;
WORD bPlanes;
WORD bBitCount;
DWORD bCompression;
DWORD bmpImageSize;
DWORD bXPelsPerMeter;
DWORD bYPelsPerMeter;
DWORD bClrUsed;
DWORD bClrImportant;
} __attribute__((packed)) BMPINF;
//彩色表:调色板 24位的真彩图不需要调色板
typede