Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/bmp.c
| Show First 20 Lines • Show All 323 Lines • ▼ Show 20 Lines | int imb_savebmp(ImBuf *ibuf, const char *filepath, int UNUSED(flags)) | ||||
| putIntLSB(sizeof(infoheader), ofile); | putIntLSB(sizeof(infoheader), ofile); | ||||
| putIntLSB(ibuf->x, ofile); | putIntLSB(ibuf->x, ofile); | ||||
| putIntLSB(ibuf->y, ofile); | putIntLSB(ibuf->y, ofile); | ||||
| putShortLSB(1, ofile); | putShortLSB(1, ofile); | ||||
| putShortLSB(is_grayscale ? 8 : 24, ofile); | putShortLSB(is_grayscale ? 8 : 24, ofile); | ||||
| putIntLSB(0, ofile); | putIntLSB(0, ofile); | ||||
| putIntLSB(bytesize, ofile); | putIntLSB(bytesize, ofile); | ||||
| putIntLSB(round(ibuf->ppm[0] + 0.5), ofile); | putIntLSB(round(ibuf->ppm[0]), ofile); | ||||
| putIntLSB(round(ibuf->ppm[1] + 0.5), ofile); | putIntLSB(round(ibuf->ppm[1]), ofile); | ||||
| putIntLSB(0, ofile); | putIntLSB(0, ofile); | ||||
| putIntLSB(0, ofile); | putIntLSB(0, ofile); | ||||
| /* color palette table, which is just every grayscale color, full alpha */ | /* color palette table, which is just every grayscale color, full alpha */ | ||||
| if (is_grayscale) { | if (is_grayscale) { | ||||
| for (char i = 0; i < 255; i++) { | for (char i = 0; i < 255; i++) { | ||||
| putc(i, ofile); | putc(i, ofile); | ||||
| putc(i, ofile); | putc(i, ofile); | ||||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||