|
|
@ -20,13 +20,13 @@ void DumpTGA(std::string filename, int width, int height, u8* raw_data) {
|
|
|
|
TGAHeader hdr;
|
|
|
|
TGAHeader hdr;
|
|
|
|
FILE* fout;
|
|
|
|
FILE* fout;
|
|
|
|
u8 r, g, b;
|
|
|
|
u8 r, g, b;
|
|
|
|
|
|
|
|
|
|
|
|
memset(&hdr, 0, sizeof(hdr));
|
|
|
|
memset(&hdr, 0, sizeof(hdr));
|
|
|
|
hdr.datatypecode = 2; // uncompressed RGB
|
|
|
|
hdr.datatypecode = 2; // uncompressed RGB
|
|
|
|
hdr.bitsperpixel = 24; // 24 bpp
|
|
|
|
hdr.bitsperpixel = 24; // 24 bpp
|
|
|
|
hdr.width = width;
|
|
|
|
hdr.width = width;
|
|
|
|
hdr.height = height;
|
|
|
|
hdr.height = height;
|
|
|
|
|
|
|
|
|
|
|
|
fout = fopen(filename.c_str(), "wb");
|
|
|
|
fout = fopen(filename.c_str(), "wb");
|
|
|
|
fwrite(&hdr, sizeof(TGAHeader), 1, fout);
|
|
|
|
fwrite(&hdr, sizeof(TGAHeader), 1, fout);
|
|
|
|
for (int i = 0; i < height; i++) {
|
|
|
|
for (int i = 0; i < height; i++) {
|
|
|
@ -41,4 +41,4 @@ void DumpTGA(std::string filename, int width, int height, u8* raw_data) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
fclose(fout);
|
|
|
|
fclose(fout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace
|
|
|
|
} // namespace
|
|
|
|