20140924 (비트맵 파일 구조)
145일차
-------------------
비트맵 파일 구조
-------------------
1. 파일 헤더
typedef struct tagBITMAPFILEHEADER
{
WORD bfType; // "BM"이라고 bitmap을 나타내는 값 저장됨
DWORD bfSize; // 바이트 단위로 전체 파일 크기
WORD bfReserved1; // 예약된 변수
WORD bfReserved2; // 예약된 변수
DWORD bfOffBits; // 실제 데이터 위치까지의 거리
}BITMAPFILEHEADER;
WORD (unsigned short) 2byte, DWORD (unsigned long) 4byte.
2. 이미지 헤더
typedef struct tagBITMAPINFOHEADER
{
DWORD biSize; // 이 구조체의 크기
LONG biWidth; // 픽셀 단위 이미지 폭
LONG biHeight; // 이미지 높이
WORD biPlanes; // 비트 플레인 수 (항상 1, 움직이는 그림은 다른수라 하던데..?)
WORD biBitCount; // 픽셀당 비트 수 (컬러, 흑백 구별)
DWORD biCompression; // 압축유무
DWORD biSizeImage; // 이미지 크기 (바이트 단위)
LONG biXPelsPermeter; // 가로 해상도
LONG biYPelsPermeter; // 세로 해상도
DWORD biClrUsed; // 실제 사용 색상 수
DWORD biClrImportant; // 중요한 색상 인덱스
}BITMAPINFOHEADER;