⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bitmap.h

📁 RMI的处理器au1200系列所用的BOOTLOAD,包括SD卡启动USB启动硬盘启动网络启动,并初始化硬件的所有参数,支持内核调试.
💻 H
字号:
#ifndef BITMAP_H
#define BITMAP_H

#include <string>
#include <fstream>
#include <vector>

typedef signed char int8;
typedef signed short int16;
typedef signed int int32;
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;

#pragma pack(1)			//byte align structures

struct BMPFileHeader 
 {    
uint16 identifier;    
uint32 fileSize;    
uint32 reserved;    
uint32 dataOffset;    
uint32 headerSize;
};

struct BMPInfoHeader 
 {    
uint32 width;    
uint32 height;    
uint16 planes;    
uint16 bitsPerPixel;    
uint32 compression;    
uint32 bitmapDataSize;    
uint32 hresolution;    
uint32 vresolution;    
uint32 colors;    
uint32 importantColors;
};

struct Pixel 
 {    
char red;    
char green;    
char blue;
};


typedef std::vector < Pixel > BitmapRow;
typedef std::vector < BitmapRow > BitmapRows;

struct Bitmap 
 {    
BMPFileHeader fileHeader;    
BMPInfoHeader infoHeader;    
BitmapRows rows;
};

typedef std::vector < Bitmap > BitmapVector;

class BitmapConverter 
 {  
public:
int load(const std::string & dibPath);    
int save(const std::string & path, int colorDepth);  
private:
BitmapVector bitmaps_;    
void display_headers(const Bitmap & bitmap);    
int output_bitmap(std::ofstream & f_out, Bitmap & bitmap,		       int colorDepth);    
int convertColor(int color, int orig, int conv);    
int bytesPerPixel_;
};

#endif				/* 
 */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -