Answer the question
In order to leave comments, you need to log in
File format specifications, how to work with them?
It is not necessary to yell strongly in the answers how to work with file specifications in C ++?
Knowledge of the language is available, there is no understanding of the specifications.
Give useful tutorials; references; sample codes, etc.
doc; pdf; rtf seems to be clear; I'm more interested in graphics.
Answer the question
In order to leave comments, you need to log in
We have a raw stream of bytes, with the help of the specifications and the structures described, we can determine where (with what offset and how much in size) and how to pull out the data.
For example, a BMP file consists of a file header, 14 bytes long ( BITMAPFILEHEADER type ), it describes the file size, its type (signature), etc..
typedef struct tagBITMAPFILEHEADER {
WORD bfType;
DWORD bfSize;
WORD bfReserved1;
WORD bfReserved2;
DWORD bfOffBits;
} BITMAPFILEHEADER;
typedef struct tagBITMAPINFO {
BITMAPINFOHEADER bmiHeader; // тип описан далее
RGBQUAD bmiColors[1];
} BITMAPINFO, *PBITMAPINFO;
typedef struct tagBITMAPINFOHEADER {
DWORD biSize;
LONG biWidth;
LONG biHeight;
WORD biPlanes;
WORD biBitCount;
DWORD biCompression;
DWORD biSizeImage;
LONG biXPelsPerMeter;
LONG biYPelsPerMeter;
DWORD biClrUsed;
DWORD biClrImportant;
} BITMAPINFOHEADER, *PBITMAPINFOHEADER;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question