19static unsigned long BMPlenfileheader(
int classv);
20static unsigned long BMPleninfoheader(
int classv);
21static unsigned long BMPlenrgbtable(
int classv,
unsigned long bitcount);
22static unsigned long BMPlenline(
int classv,
unsigned long bitcount,
unsigned long x);
23static unsigned long BMPlenbits(
int classv,
unsigned long bitcount,
unsigned long x,
unsigned long y);
24static unsigned long BMPlenfile(
int classv,
unsigned long bitcount,
unsigned long x,
unsigned long y);
25static unsigned long BMPoffbits(
int classv,
unsigned long bitcount);
37static char er_internal[] =
"%s: internal error!";
40BMPlenfileheader(
int classv)
52 pm_error(er_internal,
"BMPlenfileheader");
58BMPleninfoheader(
int classv)
75 pm_error(er_internal,
"BMPleninfoheader");
81BMPlenrgbtable(
int classv,
unsigned long bitcount)
91 pm_error(er_internal,
"BMPlenrgbtable");
94 lenrgb = (classv == C_OS2) ? 3 : 4;
95 return (1 << bitcount) * lenrgb;
106BMPlenline(
int classv,
unsigned long bitcount,
unsigned long x)
108 unsigned long bitsperline;
110 bitsperline = x * bitcount;
116 if ((bitsperline % 32) != 0)
118 bitsperline += (32 - (bitsperline % 32));
121 if ((bitsperline % 32) != 0)
123 pm_error(er_internal,
"BMPlenline");
128 return bitsperline >> 3;
135 unsigned long bitcount,
139 return y * BMPlenline(classv, bitcount, x);
146 unsigned long bitcount)
148 return BMPlenfileheader(classv)
149 + BMPleninfoheader(classv)
150 + BMPlenrgbtable(classv, bitcount);
157 unsigned long bitcount,
161 return BMPoffbits(classv, bitcount)
162 + BMPlenbits(classv, bitcount, x, y);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void pm_error(const char *format,...)
Outputs the given printf-style message to the user and terminates messily.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.