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

📄 bitmap.h

📁 lbg算法代码
💻 H
字号:
#include<iostream>
#include<fstream>
#include<cmath>
#include<string>
#include<time.h> 

using namespace std;

typedef struct//Bitmap file head struct HEAD Size:14
{
	short int bfType;	// Type  Always is BM
	char bfSize[4];	    // file size
	short bfReserved1;  // Reserved byte
	short bfTesetved2;
	short bfOffBits;	// Bitmap 点阵偏移量
	short int bi;
}HEAD;

typedef struct			// Bitmap file head struct INFO Size:40
{
	long int biSize;
	long biWidth;
	long biHeight;
	short int biPlanes;// must be 1
	short int biBitCount;// every Pixel 所占 二进制位数 Perhaps 1 4 8 32
	int biCompress;// Compression 压缩方式
	int biSizeImage;// 像素点阵大小
	int biXPelsPerMeter;// 水平像素数
	int biYPelsPerMeter;// 垂直像素数
	int biClrUsed;// 使用的Color
	int biClrImportant;// Important color
}INFO;

typedef struct// RGBQUAD struct size 4
{
	unsigned char rgbBlue;
	unsigned char rgbGreen;
	unsigned char rgbRed;
	unsigned char rgbReserved;//Reserved, nothing 
}RGBQUAD;

class CBitmap
{
private:
	HEAD strHead;// File Head 14
	INFO strInfo;// File Head Info 40
 	RGBQUAD straPla[256];//File Head Palette (调色板) 256×4
	unsigned char naImage[64][512];// File Pixel Matrix (实际上由像素对应的调色板的序号组成) 1000*64
public:
	ifstream infile;// input stream 
	CBitmap(){}
	~CBitmap(){}
	int Init(char *);//Initialization 

	void LBG();//LBG算法函数 
};

int get_rand(int s);//在1~s内生成一个随机数

⌨️ 快捷键说明

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