비트 맵 파일의 색상을 반전하는 응용 프로그램을 만들려고하지만 실제로 데이터를 수집하거나 비트 맵에서 문제가 발생합니다. 구조를 사용하여 비트 맵의 데이터를 유지하고 머리글입니다. 지금은이 :C에서 비트 맵 읽기 및 쓰기
struct
{
uint16_t type;
uint32_t size;
uint32_t offset;
uint32_t header_size;
int32_t width;
int32_t height;
uint16_t planes;
uint16_t bits;
uint32_t compression;
uint32_t imagesize;
int32_t xresolution;
int32_t yresolution;
uint32_t ncolours;
uint32_t importantcolours;
} header_bmp
struct {
header_bmp header;
int data_size;
int width;
int height;
int bytes_per_pixel;
char *data;
} image_bmp;
을 이제 실제로 읽고 난 다음이 비트 맵 작성을 위해 : 여기에서
image_bmp* startImage(FILE* fp)
{
header_bmp* bmp_h = (struct header_bmp*)malloc(sizeof(struct header_bmp));
ReadHeader(fp, bmp_h, 54);
}
void ReadHeader(FILE* fp, char* header, int dataSize)
{
fread(header, dataSize, 1, fp);
}
어떻게 내 헤더 구조에 헤더 정보를 추출 할을?
또한 누구든지 비트 맵을 읽고 쓰는 데 좋은 리소스가 있다면 알려 주시기 바랍니다. 나는 수 시간 동안 검색을 해왔으며 주제에 대해 많은 유용한 정보를 찾을 수 없다.